3. Farhan must pay a bill to a shopkeeper. The shopkeeper doesn't have any change, so Farhan must have all the notes required to pay the bill. Write a C program that reads the bill and the number of each type of note (500, 100, 50, 20, 10, 5, 2, 1) from user and then output whether it is possible for Farhan to pay the bill or not. If it is possible, then also output the number of each notes required to pay the bill. Tentative Input/Output (bold ones are user inputs): Enter amount: 1175 Enter number of notes:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
C programming 3 number solution needed
100: 6
7:12
201
KB/S
83%
Assignments: Switch-case and if-else
1. Use switch case to make a simple calculator that can ad, subtract, multiply or divide two
input numbers. The operator (+, -, * or /) should also be read from user.
Sample Input/Output:
Enter two numbers: 4.5 2.9
Enter operator: +
4.5+ 2.9 = 7.4
2. Write a C program to check whether a year is a leap year or not, using switch case.
3. Farhan must pay a bill to a shopkeeper. The shopkeeper doesn't have any change, so Farhan
must have all the notes required to pay the bill. Write a C program that reads the bill and
the number of each type of note (500, 100, 50, 20, 10, 5, 2, 1) from user and then output
whether it is possible for Farhan to pay the bill or not. If it is possible, then also output the
number of each notes required to pay the bill.
Tentative Input/Output (bold ones are user inputs):
Enter amount: 1175
Enter number of notes:
500: 1
100: 7
50:1
20:0
10:5
5:1
2:0
1:0
Farhan can pay the bill by using the following counts of different notes:
500: 1
100: 6
50:1
20:0
10: 2
5: 1
2:0
1:0
Assignment Problems: Loops (You must use a loop for solving these problems):
4. Write a program that computes the following series using for
loop: 10000+2000+400+.+8
5. Write a program that takes a minimum number, a maximum number, and common difference
and prints the sum of the arithmetic series between them.
Transcribed Image Text:100: 6 7:12 201 KB/S 83% Assignments: Switch-case and if-else 1. Use switch case to make a simple calculator that can ad, subtract, multiply or divide two input numbers. The operator (+, -, * or /) should also be read from user. Sample Input/Output: Enter two numbers: 4.5 2.9 Enter operator: + 4.5+ 2.9 = 7.4 2. Write a C program to check whether a year is a leap year or not, using switch case. 3. Farhan must pay a bill to a shopkeeper. The shopkeeper doesn't have any change, so Farhan must have all the notes required to pay the bill. Write a C program that reads the bill and the number of each type of note (500, 100, 50, 20, 10, 5, 2, 1) from user and then output whether it is possible for Farhan to pay the bill or not. If it is possible, then also output the number of each notes required to pay the bill. Tentative Input/Output (bold ones are user inputs): Enter amount: 1175 Enter number of notes: 500: 1 100: 7 50:1 20:0 10:5 5:1 2:0 1:0 Farhan can pay the bill by using the following counts of different notes: 500: 1 100: 6 50:1 20:0 10: 2 5: 1 2:0 1:0 Assignment Problems: Loops (You must use a loop for solving these problems): 4. Write a program that computes the following series using for loop: 10000+2000+400+.+8 5. Write a program that takes a minimum number, a maximum number, and common difference and prints the sum of the arithmetic series between them.
Expert Solution
steps

Step by step

Solved in 8 steps with 6 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education