Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Assignment 5 v2
#include <stdio.h> int main (void) { double gallon=21.0; double gallonPrice; char name[20]; scanf("%s", &name); if (gallon <= 30 ) { gallonPrice=0.20*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } else if(gallon <= 60) { gallonPrice=0.50*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } else if(gallon <= 99) { gallonPrice=0.80*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } else if(gallon >= 100) { gallonPrice=0.50*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } printf("Dear %s,\n", name); printf("The price in total is %lf\n", gallonPrice); printf("The amount of gallons you have consumed is %lf\n", gallon); printf("customer ID is 68461\n"); return 0; }
run
|
edit
|
history
|
help
0
Float ispis
150109_RecursividadPrimo
Spring 2017 Lab 4 v0.5
purple ghost red orange blue skulls
sizeof human
Búsqueda binaria rec
otro avance de pregunta 2
CdayName
GPS Logger || how much %
menu1.c