Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I need help in fixing a program I created. Please help me correct it, it doesn't follow the process. NOTE: It's C programming. I'm

Hi, I need help in fixing a program I created. Please help me correct it, it doesn't follow the process.

NOTE: It's C programming. I'm using dev c++

Here are the instructions and source codes:

Mark Daniels is a carpenter who creates personalized house signs. He wants an application to compute the price of any sign a customer orders, based on the following factors:

  • The minimum charge for all signs is $30.
  • If the sign is made of oak, add $15. No charge is added for pine.
  • The first six letters or numbers are included in the minimum charge; there is a $3 charge for each additional character.
  • Black or white characters are included in the minimum charge; there is an additional $12 charge for gold-leaf lettering.

Design a program that accepts data for an order number, customer name, wood type, number of characters, and color of characters. Display all the entered data and the final price for the sign.

#include

int main() { //Name input char Name[100]; printf("Welcome to Mark Daniel Crafts!"); printf(" Customer name: "); scanf(" %[^ ]N", Name);

{;

//variable declaration int wood, color, characters; int woodFees, charFees, colorFees; char woodType [10]; char colorType [29];

//wood printf(" Minimum charge is $30"); printf(" What type of wood do you prefer? \'Pine' or \'Oak\': "); scanf(" %[^ ]N", Name); scanf("sa", woodType); wood = sizeof(woodType); if (wood < 2) { woodFees = 15; } else { woodFees = 0; };

//characters printf(" How many characters should be printed? Please enter a number: "); printf(" There is a $3 charge for every character after the first o.)"); scanf("sd", &characters); if(characters>6) { charFees = (characters-6)*3; } else { charFees = 0; };

//colorvariation printf(" Do you want in Black & White or in Gold-Leaf Lettering?"); printf(" Enter either 'Black & White\' or Gold-Leaf\'."); printf(" There is a $12 charge for Gold-Leaf Lettering.)"); scanf(" %[n ]s", colorType); {; color = sizeof(colorType); if(color<=10) ( colorFees = 12 ); return 0; } } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago