Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NOTE: ALL C PROGRAMS MUST BE DONE IN UNIX SYSTEM WITH VI EDITOR 1. Write a program that asks the user to enter a U.S.

NOTE: ALL C PROGRAMS MUST BE DONE IN UNIX SYSTEM WITH VI EDITOR

1. Write a program that asks the user to enter a U.S. dollar amount and then shows how to pay that amount using the smallest number of $20, $10, $5 and $1 bills. Save the file as

dollarAmountToNotesFirstinitialLastname.c

Sample output:

Enter a dollar amount: 93

$20 bills: 4

$10 bills: 1

$5 bills: 0

$1 bills: 3

Hint: Divide the amount by 20 to determine the number of $20 bills needed, and then reduce the amount by the total value of the $20 bills. Repeat for the other bill sizes. Be sure to use integer values throughout, not floating-point numbers.

2. Write the following C program: celsius2fahrenheit should print a conversion table from Celsius to Fahrenheit, from 0 to +100 degrees Celsius, in steps of 5 degrees. Save the file ascelsius2FahrenheitaFirstinitialLastnam.c

Sample output:

Celsius Fahrenheit

----------------- -----------------

0 32

5 41

10 50

15 59

20 68

25 77

30 86

35 95

40 104

45 113

50 122

55 131

60 140

65 149

70 158

75 167

80 176

85 185

90 194

95 203

100 212

Hint: This program should be written exactly as the way it is written in C++ except the Input/Output part. You will need to use a for loop to accomplish this. Remember the control variable in the for statement must be declared outside of the for loop.

I need this written in a normal C program, not C++

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

Students also viewed these Databases questions