Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

n expression is given here. You are required to write a C++ program that solves the given mathematical expression. z=x 2 +2xy-x/y set the values


n expression is given here. You are required to write a C++ program that solves the given mathematical expression.
z=x2+2xy-x/y
set the values of x =2 and y =1
Three main tasks are to be done by each student
1. Expression solving
2. Decisions making (if-else structure)
3. Repetition structure (while loop).
After evaluating of above expression, you should add the value of z to last digit of your id. As a result,
1. If you get an odd number, then you should print your id using while loop. This while loop should run as many times as odd number you got from (z+ last digit of your id).

For example, suppose the value of z is 2 and the student's id is BC123456781. Then by adding last digit of vu id 1 to value of z, result will be 3 which is an odd number. In this case. program should print your ID for 3 times using while loop.


1. If you get an even number, then you should print your Name using while loop. This while loop should run as many times as even number you got from (z+ last digit of your id).

For example, suppose the value of z is 2 and the student's id is BCI23456782. Then by adding last digit of vu id 2 to the value of z, result will be 4 which is an even number. In this case, program should print your Name for 4 times using while loop.

Step by Step Solution

3.34 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

The detailed ... 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_2

Step: 3

blur-text-image_3

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions