Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Help!!! I'm struggling taking the code from part 1 and intergrating the direction of part 2 into it. -Modify your Project 1 code to

Please Help!!!

I'm struggling taking the code from part 1 and intergrating the direction of part 2 into it.

-Modify your Project 1 code to display the number of dollars, quarters, dimes, nickels, and pennies that the customer should receive as change only if the payment amount is greater than the amount owed. Otherwise, display a descriptive error message.

-Add a menu to offer the user a choice of processing a telegram bill or translating a message into morse code. The menu should be the first thing displayed when your program begins executing. The menu format should match the one in the Sample Output on page 2.

-Validate the users menu choice. If the user enters any number other than 1 or 2, a descriptive error message should display. See Sample Output below for format.

-If the user chooses the translate to morse code option, your program (for now) should prompt the user for a single letter and then display the cooresponding morse code. If the users input can not be translated into morse code, then a descriptive error message should display. Your program should translate both upper and lower case letters

*the morse code is at the bottom*

The code from the part one.

#include using namespace std; int main() { string Name,Address,City,State; int zip,NumberOfWords,received; double Amount; int dol,qua,dim,nic,pen,rem; cout << "Enter the name of the customer: "; getline(cin,Name); cout << "Enter street address: "; getline(cin,Address); cout << "Enter city: "; getline(cin,City); cout << "Enter state: "; getline(cin,State); cout << "Enter zip code: "; cin >> zip; cout << "Enter the number of words sent: "; cin >> NumberOfWords; Amount = (NumberOfWords/5)*1.5+(NumberOfWords%5)*0.5; //Computing amount Owed cout <> received; cout << "Denomination\t Number ------------\t-------------" << endl; rem = int(received-Amount*100); dol = rem/100; cout << "Dolars\t\t\t" << dol << endl; rem = rem - dol*100; qua = rem/25; cout << "Quaters\t\t\t" << qua << endl; rem = rem - qua*25; dim = rem/10; cout << "Dimes\t\t\t" << dim<< endl; rem = rem - dim*10; nic = rem/5; cout << "Nickels\t\t\t" << nic << endl; pen = rem - nic*5; cout << "Pennies\t\t\t" << pen << endl;

return 0; }

1

Encoding

A, a

. -

B, b

-

C, c

- . - .

D, d

- . .

E, e

.

F, f

. . - .

G, g

- - .

H, h

. . . .

I, i

. .

Letter

Encoding

J, j

. - - -

K, k

- . -

L, l

. - . .

M, m

- -

N, n

- .

O, o

- - -

P, p

. - - .

Q, q

- - . -

R, r

. - .

c

Encoding

S, s

. . .

T, t

-

U, u

. . -

V, v

. . . -

W, w

. - -

X, x

- . . -

Y, y

- . - -

Z, z

- - . .

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

=+j Enabling a productive global workforce.

Answered: 1 week ago