Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ reads S and n from the user and then displays the area of a regular polygon constructed from these values. 16 marks) QUESTION 4

C++
image text in transcribed
reads S and n from the user and then displays the area of a regular polygon constructed from these values. 16 marks) QUESTION 4 a) Provide a one sentence description of the following terms: i. null statement (1 mark) assignment operator (1 mark) iii. relational operator (1 mark) b) You are required write a program that should allow a user to enter three courses and a mark for each of three courses. The same program should compare the three marks to determine which one is the highest and display an appropriate message on the screen. The program should demonstrate branching based on relational (AND) operator. (8 marks) c) A conditional operator is the only ternary operator in C++. Provide a general form of a conditional operator and describe what it does. (3 marks) ii. Consider the statement: If x is greater than y, return the value of x; otherwise, return the value of y." The value returned is assigned to z. Write a C++ program that implements the above statement. The program should prompt the user for two numbers and then return the appropriate (6 marks) value

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago