Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Intro to Coding C++ Class using Visual on a Mac I need help i do not even know where to start! ** I attached the
Intro to Coding C++ Class
using Visual on a Mac
I need help i do not even know where to start!
** I attached the table**
o Specify the question number.
o After reading the question requirements, but before beginning any coding, create the test case table, below, through column Expected Output. Write your program then complete the test table with actual output results and include in your report.
o Copy/Paste your completed source code. You must always include standard header in your programs even if code is provided.
o Include your completed test plan after source code
o Paste in a snippet of output showing results for every listed test case, labeled with test case #
Test Table:
Test #
Valid / Invalid Data
Description of test
Input Value
Expected Output
Actual Output
Test Pass / Fail
1
2
3
4
5
6
o Add / delete rows as necessary
o Modify column widths as necessary
o Test both valid and invalid input
o Test for every output expected
o If failure is an expected output and it happens then that test Passes
o Any test that fails means the program must be fixed so that it passes the test
o A test that is expected to cause an error and does Passes
Question 1:
Create a new project. Copy and paste the program coins.cpp (below). Compile your project and fix any errors found during the compilation process. Fix any logic errors that are found during testing.
// coins.cpp
// From Ch2 of Big C++
// Takes a number of different coins as input, computes and prints total dollar value
#include
using namespace std;
const double PENNY_VALUE = 0.01;
const double NICKEL_VALUE = 0.5;
const double DIME_VALUE = 0.10;
const double QUARTER_VALUE = 0.025;
int main()
{
// declaring variables corresponding to the number of different types of coins
int pennies, nickels, dimes, quarters, dollars;
double total=0.0;
cout
cin >> pennies;
// update total now
total = total + pennies * PENNY_VALUE;
cout
cout
cin >> nickels;
// update total now
total = total + nickels * NICKEL_VALUE ;
cout
cout
cin >> dimes;
// update total now
total += dimes * DIME_VALUE ;
cout
cout
cin >> quarters
// update total now
total = total + quarters * QUARTER_VALUE;
cout
cout
cin >> dollars;
// update total now
total += dollars ;
cout
// Total value of the coins
cout
Test Table: Test Pass / Fail Expected Output Actual Output | Tes | Valid / | Description of test | Input Value ! t # invalid Data return 0;
}
Question 2:
The following program outline prompts the user for two integers and displays the results of the two integers multiplied together. Replace the comments with code to perform that task.
Compile your project and fix any errors found during the compilation and testing processes.
// put here header comments that give information about the program
// put here the compiler directive for the library necessary for reading and writing
using namespace std;
int main()
{
// declare three variables of type int
// display a message asking the user to enter a first integer
// get a value from the user
// display a message asking the user to enter a second integer
// get a value from the user
// multiply the two input values and assign to 3rd variable as result
// display message The result of multiplying your two integers together is: and display the answer on the same line
// add another version of the above display message that also first displays the two values being multiplied together
system(pause);
return 0;
}
3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started