Posts

Showing posts with the label Assignment

Java Object Oriented Practice Questions with source code

Question 1: A ggregation and Inheritance What relationship is appropriate between the following classes: aggregation, inheritance, or neither? State your reasons for each answer. a) Wheel-Bicycle b) Banana-Fruit c) Lamp-Bulb d) Flute-Guitar e) Rainbow-Colour Question 2: Alphabets to numeric values a) Using recursion, compute the sum of all numeric values of each character in a string that are in the range a-z, where a=1, b=2, … z=26. Any other character has no value. The method is case-sensitive, so uppercase letters have no value. Call the recursive method from main(). b) Now add a class called StringConverter in its own .java file, which has a recursive static method like the one just created but has an extra parameter called caseSensitive which if set to false will treat uppercase letters as lowercase letters. Call this new recursive method statically from main(). For example if this is called on the string abCde with caseSensitive set to false, it will return 15. With caseSensitive...

Recursive list mnemonics telephonic numbers with GUI for Learners

Image
Recursive list mnemonics On most telephone keypads the letters of the alphabet are mapped to various digits. In order to make their phone numbers more memorable, service providers like to find numbers that spell out some word (called a mnemonic) appropriate to their business that makes that phone number easier to remember. For example, the phone number for a physician called Smith could be 377 -6484 (DRSMITH). Write a method listMnemonics that will generate all possible letter combinations that correspond to a given number, represented as a string of digits using a recursive function. This is a recursive backtracking problem, but you are trying to find all the "solutions", not just one. In fact you are trying to find all possible Strings using the English alphabet, not just Strings that are actual "words". For example, if you call the method listMnemonics with the value 623 your method shall generate and return the following 27 possible letter combinations that corr...

Banking application in Java with source code for Learners

Banking System Your assignment is to create a file called BankAccount.java containing a class BankAccount (there is no main method in this class). A BankAccount has an initial balance type double and an id type String. You also should have a static variable to keep track of the number of accounts. The class BankAccount must include the following constructors and methods. (If your class does not contain any of the following methods, points will be deducted.) Methods & Constructors Description public BankAccount( ) : Default constructor, sets the id to "???" and balance to 0.0; public BankAccount (String initID, double initBalance): Constructs a BankAccount by setting the id to initilID, and balance to initBalance. Increment the count to keep track of the number of accounts created. public BankAccount (String customerInfo): Constructs a BankAccount object using the string containing customer's info. You need to extract the bankaccount id and the initial balance. An e...

Student Registration System Web Project using HTML, CSS & PHP

Student Registry System In this task, you’re to further develop the student registry you started on lab-task. The solution is based the on the use of HTML5, stylesheets, and PHP, and will use a database for storage of information, MySQL on (school website) is used for this. Information of students is saved in the table student, ID is primary key and is set In addition to this, you need a table named class where id a is the primary key and is set up with AUTOINCREMENT, other columns and data types in accordance with the figure. The property class in the student table needs to be a foreign key that refers to the ID column in the class table. In MySQL you need to use tables of the type INNODB with support for foreign keys, reference integrity shall remain. The task: Write a class with the name StudentRegister (means Student registry), the class should use PDO and only prepared statements/questions. The class shall implement the interface StudentInterface, and use the two classes, Student,...

Closest Event Finder in Java with complete source code

Requirements - Code in any language you like but please provide clear instructions on how we should build & run your code - Please use any source control system you like, and send us a link (or if you prefer just a zip of your project) - The first requirement is your code meets the requirements - Secondary requirements are whether your code is idiomatic for the language being coded in, easy to read, and clearly laid out Scenario - Your program should randomly generate seed data - Your program should operate in a world that ranges from -10 to +10 (Y axis), and -10 to +10 (X axis) - Your program should assume that each co-ordinate can hold a maximum of one event - Each event has a unique numeric identifier (e.g. 1, 2, 3) - Each event has zero or more tickets - Each ticket has a non-zero price, expressed in US Dollars - The distance between two points should be computed as the Manhattan distance Instructions - You are required to write a program which accepts a user location as a pair...

The game of 15 in Java with full source code

Image
The game of 15 is represented by a 4x4 matrix where there are 15 numbered cells and one cell in the blank. The problem consists of starting from a shuffled initial configuration of the cells and arriving at a final configuration with a determined order of digits. The possible movements/operators to get from one configuration to another are: 1) move the blank cell up, 2) move the blank cell down, 3) move the blank cell to the right, and 4) move the blank cell to the left. The first configuration has an optimal solution in depth 12 (the smallest number of possible moves to get from the initial configuration to the final configuration). The second initial configuration does not lead to the proposed final configuration. Explain why. While proposing only an initial and final setup for testing, prepare your program so that you can enter several initial and final settings. Therefore, write your code so that the user can choose the initial and final settings. Your code should check for a solut...

Sudoku Game Project in Java with full source code including GUI task

Introduction The purpose of the project is to try in practice the use of recursion and object-oriented program design. Please make sure to read this entire note before starting your work. Pay close attention to the sections on deadlines, deliverables, and exam rules. The problem Your task in this part of the project is to write a solver for Sudoku puzzles. Sudoku puzzles are a kind of crossword puzzles with numbers where the following two conditions have to be met: In each row or column, the nine numbers have to be from the set [1,2,3,4,5,6,7,8,9] and they must all be different.  For each of the nine non-overlapping 3x3 blocks, the nine numbers have to be from the set [1,2,3,4,5,6,7,8,9] and they ust all be different. The following two figures show a Sudoku puzzle and its solution. The input The input of your program, the Sudoku puzzles, is given in text files. More specifically, they are represented as nine lines of nine characters separated by spaces. The characters can be of two...

ERD of a multi-tenant database that records customers

Entity Relationship Diagram ERD of a multi-tenant database that records customers and some customer information types like temperature, humidity, etc. The most important thing is that it is MULTI-TENANT and it can add INFORMATION TYPES. Use Case 1:  I am a customer A and I want to add a temperature field and I am the only one who can see it Use Case 2:  I am a customer B and I want to add a humidity field and I am the only one who can see it Use Case 3:  I am the system administrator and I can modify temperature field created by customer A and expose it to customer B. CONTACT DETAILS For any other questions or other tasks please feel free to contact me via email: mhassnainjamil@gmail.com via WhatsApp: +92-324-7042178 via skype: hassnainjamil1

Recursive method to rotate a String by N characters to the right at any given number in java

Image
Write a recursive method to rotate a String by N characters to the right at any given number. For example, rotateToR(“hello”, 3) The output should be: “lohel” (And if it is a different number, of course, the output will be different). Buy now CONTACT DETAILS For any other questions or other tasks please feel free to contact me via email: mhassnainjamil@gmail.com via WhatsApp: +92-324-7042178 via skype: hassnainjamil1

Recursively printing data in java full source code with output screenshot of running program

Image
Write a recursive method that produces an output similar to the following: This was written by call number 1. This was written by call number 2. This was written by call number 3. This was written by call number 4 This was ALSO written by call number 4. This was ALSO written by call number 3 This was ALSO written by call number 2. This was ALSO written by call number 1. Buy now CONTACT DETAILS For any other questions or other tasks please feel free to contact me via email: mhassnainjamil@gmail.com via WhatsApp: +92-324-7042178 via skype: hassnainjamil1

Rotating string using recursion and printing data using recurstion in java with source code

Image
Write a recursive method that produces an output similar to the following: This was written by call number 1.   This was written by call number 2.    This was written by call number 3.      This was written by call number 4      This was ALSO written by call number 4.    This was ALSO written by call number 3   This was ALSO written by call number 2. This was ALSO written by call number 1. Write a recursive method to rotate a String by N characters to the right at any given number. For example, rotateToR(“hello”, 3) The output should be: “lohel” (And if it is a different number, of course, the output will be different). Demo Output: Buy now CONTACT DETAILS For any other questions or other tasks please feel free to contact me via email: mhassnainjamil@gmail.com via WhatsApp: +92-324-7042178 via skype: hassnainjamil1

Using Arrays, Strings, & Sorting Personnel.java TestPersonnel.java classes in Java Programming

Image
Introduction Define a Java class as described below. All variables should be declared as private and all methods as public. Save the class definition in a file with an appropriate filename. Class Name: Personnel Instance Variables:  Name – String (in the format lastName, firstName – Example: Carter, Lisa) jobTitle - String payRate – double Instance Methods:  A default constructor. A constructor that accepts three arguments, one for each of the fields. getter methods for each of the class fields. toString() A method to display the fields of an instance of the class in an easy to read format (preferable on one line). Compile and debug the above code. Class Name: TestPersonnel Then, create a class, TestPersonnel, that contains a main() with static methods to test and use the above class. Save the class in a file with an appropriate file name. Declare three initialized arrays, one for the Job Code, and two associated arrays for Job Title and the Pay Rates as follows: Declare a Per...

Linked List project in Java | Addition at specific index | Reverse List | Remove Sorted and UnSorted

Image
Java Code Extension Add the following methods to the list class on the file: public void addAt(int position, T item) The method adds an item at a given position.  The head has position 1, second item has position 2, etc. public void removeAllSorted(T item) The method removes all copies of the given item, assuming the list is sorted. For example, if you have a list (1, 2, 2, 2, 3, 4) And you remove 2 So, the output for this method will be (1, 3, 4) public void removeAllUnsorted(T item) The method removes all copies of the given item, assuming the list is not sorted. For example, if you have a list (2, 3, 4, 2, 1, 2) And you remove 2 So, the output for this method will be (3, 4, 1) public void reverseList() The method reverses the list.  For a sorted list, reversal would result in a list reversely sorted. For example, if you have a sorted list (1, 2, 3, 4, 5, 6) So, the output for this method will be (6, 5, 4, 3, 2, 1) For implementation, make sure that you use no existing metho...

Database Design and Analysis in Access | Full Project with queries and reports

Buy now Database Design Design your initial designs on paper. Each one individually works on the designs and gets together with the team members to create team designs. The first step is creation of a logical design for the database. In this step, you will identify entities/tables, their attributes, and relationships. While reading the case, identify entities/tables (hint: nouns), their attributes (hint: nouns) and relationships (hint: verbs). Also, look at the form, queries and report in the textbook and this handout to make sure that your tables include all the appropriate fields. Avoid calculated fields (ex: age, number of students, and duration of course) as actual fields in your tables. For each table, identify the primary key by underlining it. Determine the proper relationships (examples: 1:1, 1:M, M:N) among the tables and create your logical ER diagram. Use the Student Registration Database Logical Design handout given in the class as a model and design yours along the same li...

Relational Database | Chapter 2 | Full Solution | Database

Database Related Questions Discuss the importance of data modeling. What is a business rule, and what is its purpose in data modeling How do you translate business rules into data model components? What languages emerged to standardize the basic network data model, and why was such standardization important to users and designers? Describe the basic features of the relational data model and discuss their importance to the end user and the designer.***** Explain how the entity relationship (ER) model helped produce a more structured relational database design environment. Use the scenario described by "A customer can make many payments, but each payment is made by only one customer" as the basis for an entity relationship diagram (ERD) representation. Why is an object said to have greater semantic content than an entity? What is the difference between an object and a class in the object-oriented data model (OODM)? How would you model Question 7 with an OODM? What is an ERDM, a...

Employee Salary Calculator in Java using BigDecimal and Overloading Constructors

Specifications The employee class should contain overloaded constructors, one that accepts first and last names as well as annual salary, and one that accepts first and last names only.  The latter should reference the former via the "this" constructor reference. Extra Credit:  Use datatype BigDecimal for salary and tax amounts (see http://www.javaworld.com/article/2075315/core-java/make-cents-with-bigdecimal.html (Links to an external site.)) So you should fix any error in your previous assignment, and include the variation described above. The previous assignment description is repeated below: Create a project which will accept information about employee pay and then display calculated results.  The project should contain at least your executable class with the main method, as well as an Employee class. Your executable class should ask the user for the following information: Employee First Name Employee Last Name Annual Salary And it should allow the user to enter info...

HashMap and HashSet in Java | MyFavouriteClasses.java SortingAndSearching.java

Specifications There will be a total of two classes within this program as follows: MyFavouriteClasses Class This class should: Be instantiated by the other class only (not by the end user). Have a method named “populate” that will result in the names of 4 java classes (each from a different package) being stored in a HashSet. The user should be notified that this has happened. Have a method named “getClasses” that will return a HashSet containing the above Strings. Note: This should not be an “Abstract Class” SortingAndSearching Class This class is the only class that should be instantiated when testing the program. The “first” class will be instantiated via this class. This class should: Have a private method named “createMappings” that will: Create a HashMap using the class names from the HashSet as “keys” and their corresponding package names as “values”. This can be done in a number of ways so try to be as efficient a possible when designing this method. Have a constructor that wi...

Database design (Entity Relationship Diagram) and implementation of Public Library System

Design a database for public libraries.  John works for an IT service company as a senior database designer. His company just won a few contracts to serve several public library systems within the state of Maryland. Each library system operates independently though John is in charge to design a single database to store information needed for all libraries. Below are some of the data that need to be kept track of. For each library system, the database needs to store library name (e.g. “City of Baltimore Public Libraries” and “City of Annopolis Public Libraries”), phone, and mailing address. Need to store customer information including name, phone, and address. Each library issues it’s own library card to its customers. A customer can have multiple library cards, one for each library system. For example, a customer can have both Baltimore library card and Annopolis library card. Need to store library card number (different library systems may issue cards with the same number), PIN, i...

Normalizaiton of dentist-patient appointment data 1NF, 2NF and 3NF

The table shown below lists dentist-patient appointment data.  A patient is given an appointment at a specific time and date with a dentist.  On each day of patient appointments, a dentist will perform specific surgery (such as Implant S10, Root Canal S15) for that day Evaluate if the table shown above is normalized, if not describe and illustrate the process of normalizing the table shown above to third normal form.  State any assumptions you make about the data shown in this table. StaffNo Dentist Name PatNo PatName Appointment Date & Time SurgeryNo S1011 S1011 S1024 S1024 S1032 S1032 James Bond James Bond Andrew Joe Andrew Joe Kevin King Kevin King P100 P105 P108 P108 P107 P110 Kim Su Jenny Gold Ian Chappell Ian Chappell John Spooner Frank Holey 1/9/05 10.00 1/9/05 12.00 1/9/05 10.00 2/7/05 14.00 2/7/05 16.30 2/7/05 18.00 S10 S15 S10 S10 S15 S13 Is the table in 1NF, 2NF, or 3NF? If not, describe and illustrate the process of normalizing i...

Text and String Manipulation Problems in Java with FULL source code

Specification  This assessed exercise is concerned with a number of text and string problems, each of which can be solved by an efficient algorithm using an application of the suffix tree data structure. The aim of the exercise is to illustrate the wide range of practical applications of this versatile data structure, and to provide experience of manipulating the suffix tree – this should aid understanding of the structure itself. The text and string problems that we will be concerned with are as follows: searching for a given string in a piece of text; 
 determining all occurrences of a given string in a piece of text; 
 finding a longest repeated substring in a piece of text; 
 finding a longest common substring of two pieces of text. 
 You are given Java code for reading a specified text file into a string s and building the suffix tree for s. (The suffix tree construction algorithm works on the principle of repeated insertion of suffixes together with node-splitting; for the pu...