Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

41138% 11:10PM Homework #2 Course: COP 3223C Semester: Fall 2017 Due Date: October 2, 2017; 3:00 PM Credit Value: 4% of final grade Simple Conditionals

image text in transcribed

41138% 11:10PM Homework #2 Course: COP 3223C Semester: Fall 2017 Due Date: October 2, 2017; 3:00 PM Credit Value: 4% of final grade Simple Conditionals A decision tree is a way to represent the knowledge as well as the process required to make important decisions. It asks questions of the user (or of a data base) and depending upon the response, asks further questions. This continues until sufficient information becomes available to recommend a decision. The heart and soul of the implementation of a decision tree in a computer is the selection structure You have been assigned to build a program that implements a decision tree to determine why one's car engine won't run. Please implement a decision tree encompassing the following information: "Check the gasoline gauge. Is it empty? Please enter for yes and 'n' for no." If yes: "You are out of gas, idiot! Put gas in the tank" If no: "Did it stop running during use or was it parked? Please enter 'r for running or 'p' for parked." If running: "It is likely to be a failure of the generator. Please take the car to a mechanic." If parked: "Does the engine turn over normally but does not start? (y or n" If yes: "Might be a dirty fuel injector. Put in fuel injector cleaner in gas. Does it start?" If yes: "OK, you are set now. Bye. If no: "Replace the fuel filter and try it again. Did it work? (y orn" If yes: OK, you are set now. Bye. If no: "It is likely the fuel pump or spark plugs. Take it to a mechanic. If no: "Check the battery voltage. It is around 12 volts or more? (y or n) If yes: "It is probably the starter motor. Take it to a mechanic." If no: "Your battery is not holding a charge. You need a new battery Program Specifications: (musts) There are several requirements ("musts") in this assignment: 1. Your program must make use of conditional structures (it is up to you which one your use) 2. Your program must use scanf) to obtain the user's integer entries. 3. Your program must use printf() to ask the questions and print out the results to the screen. 4. Lastly (and obviously!), your program must be written in C and must compile and execute correctly on Code::Blocks using the GCC compiler Submission instructions: Same as for HW #1: Submit your program source code as a .c file through the Webcourses homework submission page. DO NOT email it to me or to the TAsl DO NOT submit the project file!lI Just submit the .c file *Please name the file as Hiv2

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

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago