Write a program for a pharmacy to generate bills. The program should ask about the code associated with the medicine and then inquire the number of tablets required. Then program should repeat this process until user enter the termination code. After that program should print the details containing the medicine name, number of tablet, price per tablet, total price for the medicine and at the last sum the total bill. List of medicine and there prices are following. Code Medicine Price / Tablet Code Medicine Price 1. Panadol 5.5 Ponstron Bruphine Folic Acid Calpol X 10.7 Fledgel Loprine Rigix Delacine C 2 8.5 7 5.9 20 21.6 3.1 19.8 25.9 10 Denizen DS 37 Your program should show output similar to the following CAUsersVamila Habib\Documents\C++ Files\Q6.exe codes Hedicine codes Panadol Fledgel Loprine Rigix De lacine C 5 E.T露, Medicine Ponstron Bruphine Folic Acid Calpol X Denizen DS 6 3 4 8 9 10 Enter the code of nedicine(-1 to quit) Enter the nunber of tablets Enter the code of nedicine(-1 to quit) Enter the number of tablets Enter the code of nedicine(-1 to quit) Enter the nunber of tablets Enter the code of nedicine(-1 to quit) Enter the number of tablets Enter the code of nedicine(-1 to quit> 1 13 31 3 ? 9 17 -1 Bill # Medicine Tablets Price (per tablet> 5.5 5.9 20.0 19.8 Total Bill Total price 1 Panadol 2 Bruphine 3 Loprine 9 Calpol X 13 31 71.5 182.9 140.0 336.6 731.0 17 Process exited after 0.05538 seconds with return value 8 Press any key to continue

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question
100%
Write a program for a pharmacy to generate bills. The program should ask about the code associated with the medicine
and then inquire the number of tablets required. Then program should repeat this process until user enter the termination
code. After that program should print the details containing the medicine name, number of tablet, price per tablet, total
price for the medicine and at the last sum the total bill.
List of medicine and there prices are following.
Code
Medicine
Price / Tablet
Code
Medicine
Price
1
Panadol
5.5
Ponstron
10.7
Fledgel
Loprine
Rigix
2
8.5
7
Bruphine
5.9
3
20
8
Folic Acid
21.6
4
3.1
Calpol X
19.8
Delacine C
25.9
10
Denizen DS
37
Your program should show output similar to the following
CA\UsersVamila Habib\Documents\C++ Files\Q6.exe
Medicine codes
Panadol
Medicine
codes
Ponstron
6
Fledgel
Loprine
Rigix
De lacine C 5
2
3
4
Bruphine
Folic Acid
Calpol X
Denizen DS
9
10
Enter the code of nedicine(-1 to quit)
Enter the number of tablets
Enter the code of nedicine(-1 to quit)
Enter the number of tablets
Enter the code of nedic ine(-1 to quit)
Enter the number of tablets
Enter the code of nedicine(-1 to quit)
Enter the number of tablets
Enter the code of nedicine(-1 to quit)
1
13
31
3
9
17
-1
%3D
Bill
了 I
Medicine
Tablets
Price
(per tablet)
5.5
5.9
20.0
19.8
Total Bill
Total price
1
2 Bruphine
3 Loprine
9 Calpol X
Panadol
13
31
71.5
182.9
140.0
336.6
731.0
17
Process exited after 0.05538 seconds with return value B
Press any key to continue
Transcribed Image Text:Write a program for a pharmacy to generate bills. The program should ask about the code associated with the medicine and then inquire the number of tablets required. Then program should repeat this process until user enter the termination code. After that program should print the details containing the medicine name, number of tablet, price per tablet, total price for the medicine and at the last sum the total bill. List of medicine and there prices are following. Code Medicine Price / Tablet Code Medicine Price 1 Panadol 5.5 Ponstron 10.7 Fledgel Loprine Rigix 2 8.5 7 Bruphine 5.9 3 20 8 Folic Acid 21.6 4 3.1 Calpol X 19.8 Delacine C 25.9 10 Denizen DS 37 Your program should show output similar to the following CA\UsersVamila Habib\Documents\C++ Files\Q6.exe Medicine codes Panadol Medicine codes Ponstron 6 Fledgel Loprine Rigix De lacine C 5 2 3 4 Bruphine Folic Acid Calpol X Denizen DS 9 10 Enter the code of nedicine(-1 to quit) Enter the number of tablets Enter the code of nedicine(-1 to quit) Enter the number of tablets Enter the code of nedic ine(-1 to quit) Enter the number of tablets Enter the code of nedicine(-1 to quit) Enter the number of tablets Enter the code of nedicine(-1 to quit) 1 13 31 3 9 17 -1 %3D Bill 了 I Medicine Tablets Price (per tablet) 5.5 5.9 20.0 19.8 Total Bill Total price 1 2 Bruphine 3 Loprine 9 Calpol X Panadol 13 31 71.5 182.9 140.0 336.6 731.0 17 Process exited after 0.05538 seconds with return value B Press any key to continue
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage