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

Hi please help.. i should Draw a flowchart and Pseudo code also 1. Write a progr

ID: 3592721 • Letter: H

Question

Hi please help..
i should Draw a flowchart and Pseudo code also

1. Write a program that accepts an integer input from the user and display the least number of combinations of 200s, 100s, 50s, 20s, 10s, 5s, and 1s.

[Test your solution using this samples]
a. Input: 250
Output: 1x200s, 1x50s
b. Input: 1127
Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s
c. Input: 1127
Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s
d. Input: 19
Output: 1x10s, 1x5s, 4x1s
[Hints]
o Use division to determine the number of occurrence of each element (i.e. 200, 100) in the input (e.g. Given 500 if we divide it by the largest number possible; which is 200; we will get 2. Therefore, there are 2x200s.)
o Use subtraction to determine the remaining value of the input. (e.g. In the 500 example, since there are 2x200s, we still have 100 to process. The 100 came from 500 – (2*200) = 100.)
o Use the next largest number possible (i.e. 100) to check the number of occurrence. Continue until the remaining value of the input is zero.

Explanation / Answer

# include # include void main() { int rs, a, b, c, d, e, f, g, h ; clrscr() ; printf("Enter the amount in Rupees : ") ; scanf("%d", &rs) ; while(rs >= 500) { a = rs / 500 ; rs = rs % 500; printf(" The no. of five hundreds are : %d", a) ; break ; } while(rs >= 100) { b = rs / 100 ; rs = rs % 100; printf(" The no. of hundreds are : %d", b) ; break ; } while(rs >= 50) { c = rs / 50 ; rs = rs % 50; printf(" The no. of fifties are : %d", c) ; break ; } while(rs >= 20) { d = rs / 20 ; rs = rs % 20; printf(" The no. of twenties are : %d", d) ; break ; } while(rs >= 10) { e = rs / 10 ; rs = rs % 10; printf(" The no. of tens are : %d", e) ; break ; } while(rs >= 5) { f = rs / 5 ; rs = rs % 5; printf(" The no. of fives are : %d", f) ; break ; } while(rs >= 2) { g = rs / 2 ; rs = rs % 2; printf(" The no. of Twos are : %d", g) ; break ; } while(rs >= 1) { h = rs / 1 ; rs = rs % 1; printf(" The no. of ones are : %d", h) ; break ; } getch() ; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote