Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ELET 2300 Assignment 1 Submit your program through Blackboard - No late submissions! Make sure that you upload the right C++ source file !!! This
ELET 2300 Assignment 1 Submit your program through Blackboard - No late submissions! Make sure that you upload the right C++ source file !!! This assignment is to be completed in CodeBlocks or related IDE/compiler. You must work alone, submit your original work, and may be asked to come to campus to explain your program anytime during the semester. The assignment consists in developing a quadratic calculator in C++ for the expression: a x2+bx+c = 0. The program is expected to work as follows: 1. Declare the variables a, b, c, first_name, and last_name in your program by selecting the most suitable data type for each variable. 2. Read the user's first and last names (see Figure 2.16.3 in the textbook for an example) 3. Greet the user using his/her first name (only the first name here) and then ask the values for a, b, and c. For example (the user's input is in indicated in bold): Please enter your name (first last): John Smith Hi John, enter the parameters a, b, c of the quadratic: Enter a: 1 Enter b: 2 Enter c: 1 4. Now, find the two roots: x1 and x2 using the usual quadratic formula and the values entered for a, b, and c: x. -626-9ac 5. Next display the quadratic expression and its roots as follows. For the values a=1, b=2, and c=1 in the example, the output must look like: 1.00 x2.00 +2.00 x + 1.00 = (x - -1.00) (x -- 1.00) "x2.00" here represents the square of x. The left-hand side is the quadratic expression with the values selected by the user. The right-hand side shows the roots. Make sure that all numbers are shown with exactly 2 decimals. See Section 8.2 "Output formatting" in the textbook for an example of how to achieve this effect using "cout" and the library "iomanip". Also note that the roots in this example are negative (-1 and -1), which is the reason why the factorization has double negative signs, so it shows "cx" followed by a negative number. Although not visually pleasant, this is fine for the purposes of this assignment. 6. Next, find the maximum/minimum point of the quadratic expression. The formula is: again, use this format to display the result with both x and y inside the parenthesis and separated by a comma. Each number shows 2 fractional digits as above. 7. Say goodbye to the user using his/her full name now. Something like (be creative): Thank you John Smith for using this program. Goodbye. 8. Add comments to your code explaining each major step. Also make sure that you follow the standard style guidelines for this and all of the assignment. They will help you write code that is easier to read (see 2.24 Style guidelines and" Programming Style to follow" under "Web Links" on the left menu bar). The coding style and comments will be part of the evaluation. Important observations: The evaluation rubric includes logic and code correctness, formatting (proper use of vertical alignment of C++ code, etc.), and explanation of steps (i.e., comments). You can check the evaluation rubric for each assignment in Blackboard. This rubric will determine your grade. You must use only the C++ instructions that we have covered in the course so fa Week 1's video explains how to install CodeBlocks and shows how to identify the file that needs to be submitted The program that you turn in must be your original and individual work. While you are allowed to discuss the program assignments in general terms with others, you are not allowed to share details of the actual solution(s) or program code with anybody except the instructor Turning in a copy of someone else's program, even a copy with extensive changes made to it, or receiving any unauthorized assistance is a very serious offense in this course An automated plagiarism checker may scan programs at any time during the semester
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started