Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i am lost as to what these level 0 and level 1 specs we haveto do for this progr

ID: 3617982 • Letter: I

Question

i am lost as to what these level 0 and level 1 specs we haveto do for this program. below is what we need to do for thisprogram:

Rewrite the program below using sub-functions. Design the functionsas you see fit.
Modify the specs accordingly and present the specs in level 0 andlevel 1, where
level 0 is for the main, and level 1 is the specs for what is donein sub-fuctions
that is called by main.

Narritive:
Write a C++ program that converts between money value and its coinequivalence.
If coin to money is desired, it asks for coin value and convertsthem to money value;
Otherwise, if money to coin is desired, it asks for money value andconverts to its
coin equivalence. Coin type is limited to quarter, dime, nickel,and penny. And
coin equivalence is restricted to the least amount of coins.

Note:
Input/output is listed as money to coin. For coin to money, justflip input and output

INPUT INFO conversion type - c for coin to money, m for money tocoin
money value - 2 decimals

OUTPUT INFO number of quarters no decimal
number of dimes no decimal
number of nickels no decimal
number of penny nodecimal


CONSTANTS as cents: QUARTER = 25
DIME = 10
NICKEL = 5
DOLLAR = 100


CONSTRAINTS 1. coin equivalence to be the least amount of coins

OPERATIONS

1. Display a menu to get user choice: c for coin to money, m formoney to coin,
   or x to exit; get user choice
2. As long as user choice is not x, do the following:
2a. If user choose c then
a. Prompt and get number of quarters, dimes, nickels, andpennies
b. Total penny = quarters * QUARTER + dimes * DIME + nickels *NICKEL + pennies
c. Money value = total penny / DOLLAR
2b. Else if user chooses m then
a. Prompt and get money value
b. Total penny is integer part of money value * DOLLAR
c. Number of quarters = total penny / QUARTER
d. Determine left over after quarter: remainder of quarter = totalpenny % QUARTER
e. Number of dime = left over of quarter / DIME
f. Determine left over of dime:
g. Number of nickel = left over of dime / NICKEL
h. Number of penny = left over of nickel
2c. Else
a. Display invalid choice
2d. Display conversion result
2e. Display a menu to get user choice: c for coin to money, m formoney to coin,
        or x to exit; get userchoice

*/

#include <iostream>
#include <iomanip>
#include <conio.h>

using namespace std;

// global constants are declared above main
const int QUARTER = 25,
DIME = 10,
NICKEL = 5,
DOLLAR = 100;

int main()
{
// items in input and output are declared as variables
// variables are declared within a function
char type; // for conversion type, c for coin to money, m for moneyto coin
int numQ,
numD,
numN,
numP,
remainder, // used to store left over values
totalPenny; // needed for intermidiate result
double moneyValue;


// step 1 - display menu and get user choice - priming read
cout << " Money Conversion Program"
<< " c - Coin to money"
<< " m - Money to coin"
<< " x - Exit"
<< " Enter you choice --> ";
cin >> type;

while(tolower(type) != 'x') // step 2
{
// step 2a, convert coin to money
if(type == 'c')
{
cout << " Enter number of quarters, dimes, nickels andpennies: ";
cin >> numQ >> numD >> numN >> numP;
totalPenny = numQ * QUARTER + numD * DIME + numN * NICKEL +numP;
moneyValue = float(totalPenny) / DOLLAR;
}


// step 2b, convert money to coin
else if (type == 'm')
{
cout << " Enter money amount: ";
cin >> moneyValue;
totalPenny = int (moneyValue * DOLLAR + 0.5);
numQ = totalPenny / QUARTER;
remainder = totalPenny % QUARTER;
numD = remainder / DIME;
remainder %= DIME;
numN = remainder / NICKEL;
numP = remainder % NICKEL;
}

// step 2c, error message
else
cout << " Type not supported. Enter c or m or x only ";

// step 2d - display conversion result
cout << setiosflags(ios::fixed|ios::showpoint)
<< setprecision(2) << endl
<< moneyValue << " dollars is equal to "
<< numQ << " quarters "
<< numD << " dimes "
<< numN << " nickels and "
<< numP << " pennies ";

// step 2e - display menu and get user choice - read another
cout << " Money Conversion Program"
<< " c - Coin to money"
<< " m - Money to coin"
<< " x - Exit"
<< " Enter you choice --> ";
cin >> type;
}

_getch();
return 0;
}
i am lost as to what these level 0 and level 1 specs we haveto do for this program. below is what we need to do for thisprogram:

Rewrite the program below using sub-functions. Design the functionsas you see fit.
Modify the specs accordingly and present the specs in level 0 andlevel 1, where
level 0 is for the main, and level 1 is the specs for what is donein sub-fuctions
that is called by main.

Narritive:
Write a C++ program that converts between money value and its coinequivalence.
If coin to money is desired, it asks for coin value and convertsthem to money value;
Otherwise, if money to coin is desired, it asks for money value andconverts to its
coin equivalence. Coin type is limited to quarter, dime, nickel,and penny. And
coin equivalence is restricted to the least amount of coins.

Note:
Input/output is listed as money to coin. For coin to money, justflip input and output

INPUT INFO conversion type - c for coin to money, m for money tocoin
money value - 2 decimals

OUTPUT INFO number of quarters no decimal
number of dimes no decimal
number of nickels no decimal
number of penny nodecimal


CONSTANTS as cents: QUARTER = 25
DIME = 10
NICKEL = 5
DOLLAR = 100


CONSTRAINTS 1. coin equivalence to be the least amount of coins

OPERATIONS

1. Display a menu to get user choice: c for coin to money, m formoney to coin,
   or x to exit; get user choice
2. As long as user choice is not x, do the following:
2a. If user choose c then
a. Prompt and get number of quarters, dimes, nickels, andpennies
b. Total penny = quarters * QUARTER + dimes * DIME + nickels *NICKEL + pennies
c. Money value = total penny / DOLLAR
2b. Else if user chooses m then
a. Prompt and get money value
b. Total penny is integer part of money value * DOLLAR
c. Number of quarters = total penny / QUARTER
d. Determine left over after quarter: remainder of quarter = totalpenny % QUARTER
e. Number of dime = left over of quarter / DIME
f. Determine left over of dime:
g. Number of nickel = left over of dime / NICKEL
h. Number of penny = left over of nickel
2c. Else
a. Display invalid choice
2d. Display conversion result
2e. Display a menu to get user choice: c for coin to money, m formoney to coin,
        or x to exit; get userchoice

*/

#include <iostream>
#include <iomanip>
#include <conio.h>

using namespace std;

// global constants are declared above main
const int QUARTER = 25,
DIME = 10,
NICKEL = 5,
DOLLAR = 100;

int main()
{
// items in input and output are declared as variables
// variables are declared within a function
char type; // for conversion type, c for coin to money, m for moneyto coin
int numQ,
numD,
numN,
numP,
remainder, // used to store left over values
totalPenny; // needed for intermidiate result
double moneyValue;


// step 1 - display menu and get user choice - priming read
cout << " Money Conversion Program"
<< " c - Coin to money"
<< " m - Money to coin"
<< " x - Exit"
<< " Enter you choice --> ";
cin >> type;

while(tolower(type) != 'x') // step 2
{
// step 2a, convert coin to money
if(type == 'c')
{
cout << " Enter number of quarters, dimes, nickels andpennies: ";
cin >> numQ >> numD >> numN >> numP;
totalPenny = numQ * QUARTER + numD * DIME + numN * NICKEL +numP;
moneyValue = float(totalPenny) / DOLLAR;
}


// step 2b, convert money to coin
else if (type == 'm')
{
cout << " Enter money amount: ";
cin >> moneyValue;
totalPenny = int (moneyValue * DOLLAR + 0.5);
numQ = totalPenny / QUARTER;
remainder = totalPenny % QUARTER;
numD = remainder / DIME;
remainder %= DIME;
numN = remainder / NICKEL;
numP = remainder % NICKEL;
}

// step 2c, error message
else
cout << " Type not supported. Enter c or m or x only ";

// step 2d - display conversion result
cout << setiosflags(ios::fixed|ios::showpoint)
<< setprecision(2) << endl
<< moneyValue << " dollars is equal to "
<< numQ << " quarters "
<< numD << " dimes "
<< numN << " nickels and "
<< numP << " pennies ";

// step 2e - display menu and get user choice - read another
cout << " Money Conversion Program"
<< " c - Coin to money"
<< " m - Money to coin"
<< " x - Exit"
<< " Enter you choice --> ";
cin >> type;
}

_getch();
return 0;
}

Explanation / Answer

please rate - thanks #include #include #include using namespace std; char menu(); double cointomoney(int&,int&,int&,int&); void moneytocoin(int&,int&,int&,int&); void output(double,int,int,int,int); // global constants are declared above main const int QUARTER = 25, DIME = 10, NICKEL = 5, DOLLAR = 100; int main() { // items in input and output are declared as variables // variables are declared within a function char type; // for conversion type, c for coin to money, m for moneyto coin int numQ, numD, numN, numP; // used to store left over values bool error; double moneyValue; // step 1 - display menu and get user choice - priming read type=menu(); while(tolower(type) != 'x') // step 2 {type=tolower(type); error=false; // step 2a, convert coin to money if(type == 'c') {moneyValue=cointomoney(numQ,numD,numN,numP); } // step 2b, convert money to coin else if (type == 'm') {moneytocoin(numQ,numD,numN, numP); } // step 2c, error message else {cout