ANSWERS: 3
-
Are you serious? That's not even a Freshman-level homework assignment.
-
I agree. That's way too simple. But I'll show you anyway: #include <stdio.h> int main(void) { float price, tip; printf("nEnter price of meal: "); scanf("%f", &price); tip = price * 0.15; printf("nTip is %f", tip); } That wasn't so hard was it?
-
That's three lines of code, if that many. Input the dollar amount to a variable Multiply the variable by .15 Display it. OR Input the dollar amount to a variable Display it * .15 And to add it to the total, Add or display the variable to the variable * .15 If you're having problems with this, you may want to rethink the class it's for.
Copyright 2023, Wired Ivy, LLC