#Homework Urgent Help

10 messages · Page 1 of 1 (latest)

true mortar
#

Need to submit in 2 hours

Need to make order calculator that follows:

  • Ask for the item
  • Ask for the quantity
  • Show the price to be paid
  • Ask if they still wanna buy
  • Let them enter their payment
  • Show if it has change, null, exact, or not buy

this is how output should look like but thats my friends (see image)

this is what i have and i dont know how to fix

west oysterBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

#

@true mortar

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

true mortar
#

#include <stdio.h>

int main()

{

int price, payment, change, quantity, yours, yesno;  

printf ("Welcome to name shop!\n\n"); 


printf ("[1] Border: Day One P1100\n");
printf ("[2] Border: Carniva P1000\n"); 
printf ("[3] Dimension: Dilemma P680\n"); 
printf ("[4] Dimension: Answer P800\n"); 
printf ("[5] Manifesto: Day 1 P980\n\n"); 

printf ("Enter your album order:    "); 
scanf ("%d", &payment); 
printf ("Enter the quantity:   "); 
scanf ("%d", &quantity); 

switch (payment) 

{ 

    case 1: 
    payment=quantity*1100; 
    printf ("Please pay the amount of %d", payment); 
    break; 

    case 2: 
    payment=quantity*1000; 
    printf ("Please pay the amount of %d", payment); 
    break; 

    case 3: 
    payment=quantity*680; 
    printf ("Please pay the amount of %d", payment); 
    break; 

    case 4: 
    payment=quantity*800; 
    printf ("Please pay the amount of %d", payment); 
    break; 
    
    case 5: 
    payment=quantity*980; 
    printf ("Please pay the amount of %d", payment); 
    break; 
    
    default:
    printf ("Please choose a valid item present in the list. Thank you for visiting."); 
    break;
#

printf ("Do you wish to proceed with the transaction? [7] if YES, [0] if NO: \n");
scanf ("%d", &yesno);

switch (yesno)
{
    case 7:
    printf ("Please enter your payment:   ");
    scanf ("%d", &yours);
    
    if (yours==payment)
    {
    printf ("Thank you for paying the desired amount. Have a great day and thank you for visiting our shop!");
    }
    else if (yours>payment)
    {
        change=yours-payment;
        printf ("Thank you for purchasing! Here is your change of %d, thank you for buying and have a great day!", change);
    }
    else if (yours<payment)
    {
        printf ("Your payment is not sufficient to pay for the products ordered, making the transaction null and void. Thank you for visiting our shop.");
    }
    
}
    
    case 0:
    printf ("Thank you for visiting our shop, have a nice day!");
}

return 0;  

}

torn wind
#

#rules 5

west oysterBOT
#

@true mortar Has your question been resolved? If so, run !solved :)

near igloo
west oysterBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.

west oysterBOT
#

This question thread is being automatically marked as stale.