CS192 CS 192 CS/192 Programming Essentials Assignments ALL WEEK 1 2 3 4 5 6 7 – an A++ Solution !!!
Week 1:
A local department Store hires you to write an automated checkout program to expedite customers in a hurry. The checkout line can only accept five items for any one purchase. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of the sales tax and the total. The sale tax is 6 percent.
Week 2:
Your English instructor, realizing you are a programmer, asks you to write a Grade Book program for his class to help him compute final grades. Design a program that asks for the student’s name and four test grades. You are to display the student’s name, four test grades, the average of the four test grades and the final letter grade the student earned in the course.
Your English instructor gives you the following grading scale:
95-100 A+
90-94 A-
85-89 B+
80-84 B-
75-79 C+
70-74 C-
65-69 D+
60-64 D-
59 or below F
Week 3:
Written Assignment: Calculator Program
Design a calculator program that will add, subtract, multiply, or divide two numbers input by a user.
Your program design should contain the following:
The main menu of your program is to continue to prompt the user for an arithmetic choice until the user enters a sentinel value to quit the calculator program.
When the user chooses an arithmetic operation (i.e. addition) the operation is to continue to be performed (i.e. prompting the user for each number, displaying the result, prompting the user to add two more different numbers) until the user enters a sentinel value to end the chosen arithmetic operation.
If the user chooses division, do not allow the user to divide by 0. Display an error message to user and ask the user to choose another denominator.
Week 4:
Written Assignment: Grade Average Program
Design a grade average program that will produce the numerical grade average of test scores input by a user.
Your program design should contain the following:
• You must use an Array as your data structure to store the input grades
• You must use a Looping structure to initialize the elements of your array to clear out system garbage.
• The user may input up to 5 test scores. Hint: This does not mean each user will input 5 scores. 3 scores may be entered for calculation.
• You must use a Looping structure to traverse the elements of your array to produce your calculation.
Week 5:
Written Assignment: Body Mass Index Program
You are the nutritional coach for a local high school football team. You realize that some of the players are not up to par having returned from summer break. Realizing nutrition plays a key in a productive team, you decide to implement a Body Mass Index Program.
Design a modularized Body Mass Index (BMI) Program which will calculate the BMI of a team player. The formula to calculate the BMI is as follows:
BMI = Weight * 703/Height2
Your program design should contain the following:
• A method to obtain the weight of a player
• A method to obtain the height of a player
• A method to calculate the BMI of a player
• A method to display the calculated BMI
• A main method
Week 6:
Written Assignment: Pet Class
Design a class named Pet, which should have the following fields:
· Name – The name field holds the name of a pet.
· Type – The type field holds the type of animal that is the pet. Example values are “Dog”, “Cat”, and “Bird”.
· Age – The age field holds the pet’s age.
The Pet class should also have the following methods:
· setName – The setName method stores a value in the name field.
· setType – The setType method stores a value in the type field.
· setAge – The setAge method stores a value in the age field.
· getName – The getName method returns the value of the name field.
· getType – The getType method returns the value of the type field.
· getAge – The getAge method returns the value of the age field.
Once you have designed the class, design a program that creates an object of the class and prompts the user to enter the name, type, and age of his pet. This data should be stored in the object. Use the object’s accessor methods to retrieve the pet’s name, type, and age and display this data on the screen.
Week 7: Employee Production Worker Program
Design an Employee class that has fields for the following pieces of information:
· Employee Name
· Employee Number
Next, design a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to hold the following information:
· Shift Number (an integer, such as 1, 2, or 3)
· Hourly Pay Rate
The workday is divided into two shifts: day and night. The shift field will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Design the appropriate accessor and mutator methods for each class.
Once you have designed the classes, design a program that creates an object of the ProductionWorker class and prompts the user to enter data for each of the object’s fields. Store the data in the object and then use the object’s accessor methods to retrieve it and display it on the screen.
You are to submit the following for the assignment:
RAPTOR file with the flowchart of your working program. Make sure you run it to make sure it is error free and does what it is supposed to do.
Use the generate dropdown to create example C++ code based on your working logical flow chart. Also attached the code in a Microsoft Word file or a text file.
Remember to follow the guidelines of good program design. Make sure to use meaningful variable names and include comments as needed.