Your Perfect Assignment is Just a Click Away

Starting at $8.00 per Page

100% Original, Plagiarism Free, Customized to Your instructions!

glass
pen
clip
papers
heaphones

Santa Monica College Standard Basic C Program of Online Orders

Santa Monica College Standard Basic C Program of Online Orders

Question Description

Prompt:

In the space provided below write a C program that computes the total cost of items you want to order online. It does so by first asking how many items are in your shopping cart and then based on that number, it repeatedly asks you to enter the cost of each item.

It then adds a 5% delivery charge for standard delivery if the total is BELOW $1000, and an additional 10% charge if you want expedited shipping.

Requirements:

include screenshots demoing the execution of the program

use proper c language

re-write code when applicable

point out errors

So I’ve wrote my code here but I keep getting a syntax error message. Can you please clarify in your answer what I did wrong.

the error message I get is:

main.c: In function ‘main’:

main.c:45:1: error: ‘else’ without a previous ‘if’ else if( yes == 1 ) ^~~~


#include<stdio.h>

int main()

{

int items, i, yes = 1, no = 0;

double standardShip = 0.05, fastship = 0.1, totalCost, cost;

printf(“How many items are in your cart?n”);

scanf(“%d”, &items);

for (i=1; i <=items; i++)

{

printf(“Enter total cost of itemsn”);

scanf(“%lf” , &cost);

totalCost = totalCost + cost;

};

if (totalCost<=1000)

{

printf(“You will be charged regular shippingn”);

totalCost=totalCost+cost*standardShip;

printf(“Your new total is:%lfn” , totalCost);

}

else if( yes == 1 )

{

printf(“Please enter 1 for fast shippingn”);

scanf(“%d” , &yes);

printf(“You will be charged extra for expedited shipping”);

totalCost= totalCost+cost*fastship;

printf(“Your new total is: %lfn”, totalCost);

}

else

{

totalCost=totalCost+cost*standardShip;

printf(“Your total is: %lf” , totalCost);

}

return 0;

}


"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.