I am very new to programming and do not know what is wrong with this code...
project due soon. need feedback asap please...
[CODE=c]#include <stdio.h>
// Constant
#define COST_OF_GLASS .02
int main() {
// Declare and initiate variables
int length;
int width;
int height;
int cost;
// Prompt length
printf("Please enter the length of the tank.\n");
scanf("%lf", &length);
// Prompt width
printf("Please enter the width of the tank.\n");
scanf("%lf", &width);
// Prompt height
printf("Please enter the height of the tank.\n")
scanf("%lf", &height);
// Calculate glass demensions
total1 = (length * height)*2
total2 = (length * width)*2
total3 = (height * width)
total = total1 + total2 + total3
cost = total * .02
// Print results
printf("The goldfish tank costs %lf cost to build")
return 0;
}[/CODE]
project due soon. need feedback asap please...
[CODE=c]#include <stdio.h>
// Constant
#define COST_OF_GLASS .02
int main() {
// Declare and initiate variables
int length;
int width;
int height;
int cost;
// Prompt length
printf("Please enter the length of the tank.\n");
scanf("%lf", &length);
// Prompt width
printf("Please enter the width of the tank.\n");
scanf("%lf", &width);
// Prompt height
printf("Please enter the height of the tank.\n")
scanf("%lf", &height);
// Calculate glass demensions
total1 = (length * height)*2
total2 = (length * width)*2
total3 = (height * width)
total = total1 + total2 + total3
cost = total * .02
// Print results
printf("The goldfish tank costs %lf cost to build")
return 0;
}[/CODE]
Comment