Program 1,2,3,4 – All Programs with screenshot – Instant Delivery – Perfect Solution
Program 1: Car Management
2. Below is a sample interface of a CAR MANAGER app.
– <<…… >> are instructions you should program Write a Visual Studio 2012 C# Console App that manages car information
– Other characters (in red) are messages you should display in the monitor.
– You may assume that a user will enter only valid characters, e.g., a user will enter only numbers for the miles ran.
3. You should create a class for the car information management, and all the information should be saved and accessed to/from the class. You cannot use any variables for the information storing purpose in the Main method.
4. Place your name as a comment in your code
5. Hint: Refer to the code in Fig. 3.22 in the textbook (or in the class slide for Ch03) for type conversions and getting user’s inputs.
______________________________________________________________________________
*****************************
* *
* WELCOME TO CAR MANAGER *
* By << show your name >> *
* *
*****************************
<< Place one empty line here>>
Enter # of Wheels of a car: << get input from keyboard on the same line>>
Enter the color of the car: << get input from keyboard on the same line >>
Current Mileage will be set Zero.
The starting CAR POINT is 100000 pts.
<>
<< Place three space characters here>>===> The current status of your car: <> Wheels, <>,<> miles, and CAR POINT= << show the CAR POINT of this car>>.
<< Place one empty line here>>
Enter owner’s name: << get input from keyboard on the same line>>
<< Save this name to an attribute in your class for car management>>
Enter the miles the car ran in this week: << get input from keyboard on the same line. Enter a number more than 50>>
<< Calculate a new CAR POINT and Save it to an attribute in your class for car management >>
<< Formula for A NEW CAR POINT = Previous car point – miles ran * 0.5 >>
<< Update the mileage of your car >>
<< Place three space characters here>>===> This car is owned by <>.
<< Place three space characters here>>===> The current status of your car: <> Wheels, <>,<> miles, and CAR POINT= << show the CAR POINT of this car>>.
************ Thank you for using CAR MANAGER *************
<< Place 2 empty lines here>>
Press ENTER to close console…….
<< get input from keyboard on the next line. If ENTER key is pressed, then quit the program>>
Program 2: Number Baseball Game
Program 2 – Number Baseball Game with screenshot – Instant Delivery – Perfect Solution
Lab Price = $12 Please feel free to send us your queries at: [email protected]
Payment methods
Add to CartBuy Now
View Cart
Problem Statement
Game Description:
1. This game is a hidden number finding game called the Number Baseball Game.
2. At the beginning of the game, a computer chooses randomly three numbers among 1 to 9. But this numbers are not shown to a game player. The numbers cannot be duplicated.
Example) 913, 319, 457, 175…. 335 (incorrect), 340 (incorrect)
3. The computer accepts three numbers from the player and shows the result for the input. If a number in player’s input matches a number in computer’s number and is placed in the same order, it is considered 1 strike. If a number in player’s input matches a number in computer’s number but is not placed in the same order, it is considered 1 ball.
Example) a computer’s number: 913, a user’s input: 935 ==> 1 strike and 1 ball
a computer’s number: 913, a user’s input: 915 ==> 2 strikes
a computer’s number: 913, a user’s input: 395 ==> 2 balls
a computer’s number: 913, a user’s input: 865 ==> No strike and no ball.
4. Allow up to five times of trial for each game. If a player gets three strikes within five times, it is a win of the player. If a player doesn’t get three strikes within five times, it is a loss of the player. Show the message for win or loss.
5. After each game, show the total number of games played and wins and the win percentage of the user. After that, ask the player whether to continue. If the player wants to continue, start a new game. Otherwise, terminate the program.
Programming Requirements:
1. Write a Visual Studio 2012 C# Console App that plays the Number Baseball Game.
2. Use at least one static method (except Main method) and one instance method.
3. Include your class (es) in the namespace called “NumBaseBall.”
4. At the beginning of the game, show your name.
5. After creating computer’s number, show them for the grading, but consider them as hidden to the game player.
Program 3: Invoice Management
Business Situation:
A business sends out invoices to its customers. An invoice has the following data: Invoice Number, Customer Name, Product Number, Product Description, Quantity, Unit Price, Extended Price, and Invoice Total. This business may have up to 100 invoices, and an invoice may have 10 items at most.
The Application should display the following data on the console: Invoice Number, Customer Name, Product Number, Product Description, Quantity, Unit Price, Extended Price (Unit Price * Quantity), and Invoice Total. There should be one line for each item, and the Invoice Total should be displayed at the end of each invoice.
The following data is given (it also can be used as a display format):
Invoice Number: 1
Customer Name: James Bond
Product Number Description Quantity Unit Price Extended Price
83 Electric Sander 7 67.98 XXX,XXX
24 Power Saw 18 89.99 XXX,XXX
7 Sledge Hammer 11 23.50 XXX,XXX
================================================================
Invoice Total: XXX,XXX
Invoice Number: 2
Customer Name: Ethan Hunt
Product Number Description Quantity Unit Price Extended Price
77 Hammer 76 12.99 XXX,XXX
39 Lawn Mower 3 76.50 XXX,XXX
68 Screwdriver 106 9.99 XXX,XXX
45 Nail-3mm 1000 0.05 XXX,XXX
================================================================
Invoice Total: XXX,XXX
Invoice Number: 3
Customer Name: Ethan Hunt
Product Number Description Quantity Unit Price Extended Price
83 Electric Sander 11 67.98 XXX,XXX
24 Power Saw 28 89.99 XXX,XXX
7 Sledge Hammer 21 23.50 XXX,XXX
================================================================
Invoice Total: XXX,XXX
Programming Requirements:
1. Write a C# Visual Studio Console Application that uses an Invoice and Invoice Line Item classes and display the Invoice data on the console for 3 invoices from two customers.
2. Your application MUST have an Invoice class and MUST use Invoice objects to store the information for invoices. Invoice objects MUST be stored in an array declared in Main() method.
3. Your application MUST have an Invoice Line Item class and MUST use Invoice Line Item objects to store the information for line items.
4. An Invoice class MUST have an array to store the objects of line items.
5. At the beginning of the program, the data for the invoice MUST be assigned and/or Calculated in the Main() method and all invoice-related information MUST be stored only in Invoice and Invoice Line Item objects.
6. The Invoice output should be generated in the Main() of a Company class.
Program 4: Salary Information Management
Create a Visual Studio C# Console Application for the following:
1. Declare an abstract class (not an interface) called “EmployeeSalary” and create a concrete class called “DoctorSalary” to manage the salary information by inheriting the EmployeeSalary class.
2. Use a List collection whose elements are DoctorSalary classes to manage the data below.
3. Write LINQ query for each of the following and display each result separately from the List collection.
(a) Sort the List by Name in ascending order and display EmpNumber, Name, NumPatient, BonusPerPatient, and BaseSalary
(b) For each object in the List calculate NumPatient * BonusPerPatient + BaseSalary and name the Calculated column TotalSalary. Display the List of objects in ascending order of TotalSalary
(c) Display the List of objects whose TotalSalary is greater than $15,000 in ascending order of TotalSalary.
In the item (b) and (c), “Display the List of object” means you should display EmpNumber, Name, NumPatient, BonusPerPatient, BaseSalary, and TotalSalary
Data:
EmpNumber Name NumPatient BonusPerPatient BaseSalary
83 James Bond 150 $50 $6,000
24 Matthew Kennedy 190 $50 $6,500
7 Luck Scott 156 $53 $6,300
77 James Young 176 $49 $6,300
39 Michael Fielder 123 $79 $7,000
68 Robert King 106 $48 $7,000