Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Assignment 3 Final
//gcc 5.4.0 #include <stdio.h> int main(void) { float yogurtPrice=4; int yogurtQ=1; float applePrice=5; int appleQ=1; float beerPrice=10; int beerQ=1; float sodaPrice=7; int sodaQ=1; char name[40]; int cardNumber; int expirationMonth; int expirationYear; float totalPrice; int quantity; scanf("%d %d %d %d", &yogurtQ, &appleQ, &beerQ, &sodaQ); scanf("%d", &cardNumber); scanf("%d %d", &expirationMonth, &expirationYear); printf("The expiration date is %d/%d\n",expirationMonth, expirationYear); yogurtQ--; totalPrice=(yogurtPrice*yogurtQ)+(applePrice*appleQ)+(beerPrice*beerQ)+(sodaPrice*sodaQ); totalPrice=totalPrice*1.05; quantity=yogurtQ+appleQ+beerQ+sodaQ; printf("The total price %.02f\n", totalPrice); scanf("%s", name); printf("Thank you %s\n", name); return 0; }
run
|
edit
|
history
|
help
0
ptr_to_ptr
Búsqueda binaria rec
Maximum of Arrays
18BCE2182 ASSESS_1 Q2-1
A_141117_Primo02
My first reevers C 2darryp
tarea1
purple ghost red orange blue skulls
fork
WAP in C to print the reverse of a string