Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER ASAP DUE TODAY! USE C++ PROGRAM!! THANK YOU!! Question 1: Create a new project. Copy and paste the following program. Compile and fix

PLEASE ANSWER ASAP DUE TODAY! USE C++ PROGRAM!! THANK YOU!!

Question 1: Create a new project. Copy and paste the following program. Compile and fix any syntax errors found during the compilation process. Fix any logic errors that are found during testing and re-run the test. Test your program using the following 11 sets of test data (each input value is separated by a comma, but youll hit the enter key). Before testing, you should guess/calculate by hand what the answers will be. Then, when running the test cases, you can verify your earlier calculations and correct your program if necessary. The first eight tests should all work, the last three are testing for ID10T users and you dont need to correct your program for errors found, just record what your program does. Submit output snippets of all 11 test cases, numbered by the test case it is for (1.1, 1.2, 1.3, etc.). 1. 0, 0, 0, 0, 0 2. 1, 0, 0, 0, 0 3. 0, 1, 0, 0, 0 4. 0, 0, 1, 0, 0 5. 0, 0, 0, 1, 0 6. 0, 0, 0, 0, 1 7. 1, 1, 1, 1, 1 8. 0, 0.5, 2, 3, 4 9. 3, hello, 1, 1, 1, 1 10. 5, my6, 0, 0, 0, 0 11. 10, -4, 0, 0, 0, 0 // coins.cpp // Takes a number of different coins as input, computes and prints total dollar value #include using namespace std; const double QUARTER_VALUE = 0.025; const double DIME_VALUE = 0.10000; const double NICKEL_VALUE = 0.5; const double PENNY_VALUE = .001; int main() { // declare variables corresponding to different types of coins int pennies, nickels, dimes, quarters, dollars; double total=0; /****** ** PENNIES *******/ cout << "How many pennies do you have? "; cin >> pennies; // update running total to include pennies total += pennies * PENNY_VALUE; cout << "Current total is " << total << endl /****** ** NICKLES *******/ cout << "How many nickels do you have? "; cin >> nickels;

// update running total to include nickles total += nickles * NICKEL_VALUE ; cout << "Current total is " << total << endl; /****** ** DIMES *******/ cout << "How many dimes do you have? "; cin >> dimes; // update running total to include dimes total = dimes * DIME_VALUE ; cout << "Current total is " << total << endl; /****** ** QUARTERS *******/ cout << "How many quarters do you have? "; cin >> quarters // update running total to include dimes total = total + quarters; cout << "Current total is " << total << endl; /****** ** DOLLARS /****** cout << "How many dollar coins do you have? "; cin >> dollars; // update running total to include dollars total += dollars ; cout << "Current total is " << total << endl; // Display total value of all coins cout << "Total value = " << total << " "; system("pause"); return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions