Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Decision Statements Overview For this daily, the goal is to practice writing basic decision statements and simple conditions. A CPP file (decisions.cpp) has been provided.

Decision Statements Overview For this daily, the goal is to practice writing basic decision statements and simple conditions. A CPP file (decisions.cpp) has been provided. It contains the declarations for two integer variables (x and y), a declaration for a character variable (single_letter), a declaration for a string variable (word), and code that will ask the user to enter two integer values, a character value, and a string value. Add decision statements to the main.cpp file that will: Check if x is greater than y. If true, display that the x value is greater than the y value, making sure to display the actual values that the x and y variables are holding. Check if x is less than y. If true, display that the x value is less than the y value, making sure to display the actual values that the x and y variables are holding. Check if x is greater than or equal to y. If true, display that the x value is greater than or equal to the y value, making sure to display the actual values that the x and y variables are holding. Check if x is less than or equal to y. If true, display that the x value is less than or equal to the y value, making sure to display the actual values that the x and y variables are holding. Check if x is equal to y. If true, display that the x value is equal to the y value, making sure to display the actual values that the x and y variables are holding. Check if x is not equal to y. If true, display that the x value is not equal to the y value, making sure to display the actual values that the x and y variables are holding. Check if the character variable single_letter is equal to the character P. If true, display PINEAPPLE. Check if the string variable word is equal to the string C++. If true, display C PLUS PLUS. File You Must Submit Place the program code in a source file named decisions.cpp Output The output that is produced by the program will vary based on the values that are entered when the program is executed. Some examples of running the program follow: Enter a number (NO decimal point): 24 Enter another number (NO decimal point): 3 Enter a single character: P Enter a word: C++ 24 is greater than 3 24 is greater than or equal to 3 24 is not equal to 3 PINEAPPLE C PLUS PLUS ---------------------------------------------------------------------------------------- Enter a number (NO decimal point): 87 Enter another number (NO decimal point): 94 Enter a single character: g Enter a word: Hello 87 is less than 94 87 is less than or equal to 94 87 is not equal to 94 ---------------------------------------------------------------------------------------- Enter a number (NO decimal point): 8 Enter another number (NO decimal point): 8 Enter a single character: p Enter a word: C++ 8 is greater than or equal to 8 8 is less than or equal to 8 8 is equal to 8 C PLUS PLUS ---------------------------------------------------------------------------------------- Enter a number (NO decimal point): -12 Enter another number (NO decimal point): 12 Enter a single character: P Enter a word: C-- -12 is less than 12 -12 is less than or equal to 12 -12 is not equal to 12 PINEAPPLE

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

What is powershell providers, and powershell drive?

Answered: 1 week ago