Untitled Assignment 1 Minimum/Maximum: Write a program that asks the user to enter two numbers. The program should use the condi8onal operator to determine which number is the smaller and which is the...

1 answer below »
I need to get done two assignments and details are attached


Untitled Assignment 1 Minimum/Maximum: Write a program that asks the user to enter two numbers. The program should use the condi8onal operator to determine which number is the smaller and which is the larger. 1. Create a C++ project named PP5_MinMax_yourName. 2. Add a comment line that tells the purpose of the program at the top of the program. 3. Define variables for two numbers. 4. Write an if statement to compare the numbers. 5. Then display the result of small and large number. OPTIONAL: Write a C++ program that asks the user to enter 4 numbers. Sort the numbers in descending (max to min) order and display the sorted numbers on the screen. Assignment #2 – Grocery Shopping: Write a C++ program that allows a user choose item to purchase from a list; ask for the amount to calculate the cost of the purchase; offer to add a 8p; add a delivery fee based on the subtotal; then calculate the total amount that the user needs to pay. ---------------------------------- ----- GROCERY SHOPPING ITEMS ----- 1. Milk - $5.99 / gallon 2. Egg - $6.99 / dozen 3. Cheese – $10.98 / 8oz 4. Pasta – $2.75 / packet ---------------------------------- Other Values to be used in the program. TIP (Optional) : $5.00 SHIP_RATE1 (for $20 or below) : $0.00 SHIP_RATE2 (for between $20 and $35): 4.35 SHIP_RATE3 (for above #35) : 7.65 Follow the Steps Below 1. The grocery list items and their prices are given above. You need to print it in the same format in your program. Use formaGng output feature of the cout. 2. Ask the user to choose one of the items. Use the switch statement to evaluate user’s selec8on. 3. Ask the user to enter quanJty of the chosen item. Then calculate the cost of the purchase. 4. Ask the user if he/she wants to pay a $5 8p. If the answer Yes, then add $5 to the cost; otherwise, keep the cost as it is. Use condiJonal formaGng to code this. 5. Chek the subtotal. If it is less than or equal to $20.00, the shipping is free. If it is greater than $20.00 and less than or equal to $35.00, the shipping is $4.35. If it is greater than $35, then the shipping is $7.65. Based on the decision here calculate the total price that the user needs to pay. 6. Format the total price in fixed-point notaJon, with two decimal places of precision, and be sure the decimal point is always displayed. • Define all the numbers that you need to use in the program as named constants. Use their iden8fier in the calcula8ons instead of the values. • Iden8fy variables with descripJve names. • Use comment lines for each block of your program to describe the purpose of that block statement. • Add a comment line at the top to tell the purpose of the program. You must submit both files (zipped project folder and .cpp extension) of the program. Rubric • Code readability with indenta0ons, spaces when necessary (5 points) • Comment lines for descrip0on (5 points) • Variable defini0ons with proper iden0fier and the right data type (7 points) • Constant defini0ons with proper iden0fier and the right data type (8 points) • Forma;ng output for the Menu display and the total price display (15 points) • The use of the switch statement (15 points) • The use of the condi0onal forma;ng (10 points) • The use of the if /else statement. (15 points) • Correct calcula0ons. (10 points) • Proper message display (5 points) • Submi;ng the correct files (5 points)
Answered Same DaySep 25, 2021

Answer To: Untitled Assignment 1 Minimum/Maximum: Write a program that asks the user to enter two numbers. The...

Aditya answered on Sep 26 2021
146 Votes
#include
#include
using namespace std;
int main()
{
int userChoice; // th
is is used to store the userChoice entered
int quantity; // this is used to store the quantity user is buying
string itemBought;// the name of item bought
double itemPrice;// the price of item bought
bool loop = true;
char tip;// user to store input for tip from user
double billingAmount;// total billing amount
const int tipAmount = 5;// used to store tip amount
// Displaying the grocery items
cout<<"----------------------------------"< cout<<"----- GROCERY SHOPPING ITEMS -----"< cout<<"1. Milk - $5.99 / gallon"< cout<<"2. Egg - $6.99 / dozen"< cout<<"3. Cheese - $10.98 / 8oz"< cout<<"4. Pasta - $2.75 / packet"< cout<<"----------------------------------"< // this loop is made so that user enter correct value for grocery item
while(loop)
{
// Prompting the user to...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here