0% found this document useful (0 votes)
40 views4 pages

Program Menu Makanan: #Include #Include Using Namespace Int

This C++ program calculates food orders from a menu. The menu includes 3 items with codes 0, 5, and 8. The program prompts the user to input an item code and quantity, calculates the total price and applies any discounts or bonuses based on the quantity. It then outputs the item name, price, quantity, total price, discount amount, discounted total price, and any applicable bonus.

Uploaded by

Moh Erfan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views4 pages

Program Menu Makanan: #Include #Include Using Namespace Int

This C++ program calculates food orders from a menu. The menu includes 3 items with codes 0, 5, and 8. The program prompts the user to input an item code and quantity, calculates the total price and applies any discounts or bonuses based on the quantity. It then outputs the item name, price, quantity, total price, discount amount, discounted total price, and any applicable bonus.

Uploaded by

Moh Erfan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

PROGRAM MENU MAKANAN

#include "stdafx.h"
#include "iostream"
using namespace std;
int main ()
{
int kode,jum;
char* nama;
char* bonus;
double harga,tharga,diskon,thdiskon;
cout"*******!"#$"% &'() &"*"("(*******"endlendl;
cout"+++++++++++++++++++++++++++++++++"endl;
cout", *-!' ("&" &"*"("( ."%/" ,"endl;
cout"+++++++++++++++++++++++++++++++++"endl;
cout", 0 ("12 /-%'(/ 3444 ,"endl;
cout", 5 "6"& 7'(6'$ 04444 ,"endl;
cout", 8 &2' /-%'(/ 9444 ,"endl;
cout"+++++++++++++++++++++++++++++++++"endl;
cout"!21*-( :;0:< =2*" > 5 7-%12 ? @-()1 "endlendl;
cout"2nput *ode &akanan 6ang !ipesan + ";cin>>kode;
cout"2nput =umlah 7orsi 6ang !ipesan + ";cin>>jum;
sAitch (kode)
{
case 0 B{
nama+"("12 /-%'(/";
harga+3444;
tharga+jum*harga;
if (jum>5)
{
diskon+4.04*tharga;
thdiskon+tharga;diskon;
bonus+"$'. /'C"1";
D
else
{
diskon+ 4 ;
thdiskon+tharga;
bonus+"$idak "da";
D
break;
D
case 5 B{
nama+""6"& 7'(6'$";
harga+04444;
tharga+jum*harga;
if (jum>5)
{
diskon+4.0:*tharga;
thdiskon+tharga;diskon;
bonus+"$'. -";
D
else
{
diskon+ 4 ;
thdiskon+tharga;
bonus+"$idak "da";
D
break;
D
case 8 B{
nama+"&2' /-%'(/";
harga+9444;
tharga+jum*harga;
if (jum>5)
{
diskon+4.04*tharga;
thdiskon+tharga;diskon;
bonus+"$'. @-$-C";
D
else
{
diskon+ 4 ;
thdiskon+tharga;
bonus+"$idak "da";
D
break;
D
D
coutendl;
cout"&"*"("( 6"(/ "(!" 7'1"( "!"C". B"endlendl;
cout"(ama &akanan + "namaendl;
cout".arga &akanan + "hargaendl;
cout"=umlah 7orsi &akanan + "jumendl;
cout"$otal .arga + "thargaendl;
cout".arga !iskon + "diskonendl;
cout".arga 1etelah !iskon + "thdiskonendl;
cout"@onus untuk "nda + "bonusendlendl;
sEstem("pause");
return 4;
D
."12C(6" *"C") !2 %)( B
0.
KODE=1, JUM=2 Diskon dan Bonus : Tidak ada
5.
KODE=2, JUM=3 (JUM>2) Diskon 15% dan Bonus TEH O
8.
KODE=3, JUM=6 (JUM>2) Diskon 5% dan Bonus THE BOTO

You might also like