Rate this product
Purpose: Learn how to get input and print out formatted results using scanf and printf separately in C.
Part 1:
1) Write a C program named as getPhoneNumber.c that prompts the user to
enter a telephone number in the form (999)999-9999 and then displays the
number in the form 999-999-999:
Enter phone number [(999)999-9999]: (404)123-4567You entered 404-123-4567Question: Execute your getPhoneNumber.c and attach a screenshot of the output. Then
write the source code of getPhoneNumber.c in your answer sheet and upload your file getPhoneNumber.c to googleClassroom.
2) Write a program named as calcPrice.c that formats product information entered by the user and calculate the total amount of purchase.
Enter item number:583Enter unit price:13.5Enter quantity:2Enter purchase date (mm/dd/yyyy):09/15/2016Item Unit Price QTY Purchase Date Total Amount
583 $ 13.50 2 9/15/2016 $ 27.00
The item number, quantity and date should be left justified; the unit price and total amount should be right justified. Hint: Use tabs to line up the columns.
Question: Execute your calcPrice.c and attach a screenshot of the output. Then write the source code of calcPrice.c in your answer sheet and upload your file calcPrice.c to classroom.
Part 2: (Optional)
Note : This part is not for grading. But you will get some feedback.
Reviews
There are no reviews yet.