c++

write the code and the flowchart

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Name:

KCST ID:

CE-100 Introduction to Computer Systems

Tutorial 5 – Decision Structures (Nested decision structures, Logical operators)

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

OBJECTIVES:
1. Learn how to use nested decision structures in C++ programs
2. Learn the if-else-if ladder structure, in particular.

3. Understand the Boolean operators and their use in Boolean expressions.
RULES:
 Hand write your answers, both flowchart and code, on a separate sheet of paper.

 it is recommended to use pencil for drawing flowcharts.

Assignment Problems:
Draw the flowchart and write C++ code to solve the following problems (Q1, Q2)

Q1. Input a KCST ID (10 digits). Based on its first 2 digits, display the following message:
First 2 digits of ID Message to print

16 You enrolled in 2016

17 You enrolled in 2017

18 You enrolled in 2018

19 You enrolled in 2019

otherwise Invalid ID
Hint: a regular C++ int is large enough to fit any valid KCST ID.

Q2. Input three integer numbers. Print the smallest one. If two or more numbers are equal,

print: “some are equal”

Q3. What is the output of this program?

#include
using namespace std;

int main() {

int a, b, c;
a = 9; b = 5; c = 2;

if (a < b)

if (a < c) cout << a;

else
cout << c;

else
if (b < c)

cout << b; else

cout << c;

return 0;
}

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.

Order your essay today and save 30% with the discount code ESSAYHELP