PART 1. EXAMINE THE FF. CODE int numValue =2; int answer =0; switch(numValue){ case 1: answer +=1; case 2: answer +=2; case 3: answer +=3; break; case 4: answer +=4; case 5: answer +=5; default:...


PART 1. EXAMINE THE FF. CODE



int numValue =2;


int answer =0;


switch(numValue){


case 1: answer +=1;


case 2: answer +=2;


case 3: answer +=3;


            break;


case 4: answer +=4;


case 5: answer +=5;


default: answer =0;


            break;


} cout <”answer: ”="">< answer=""><>



1. What is the answer(output) if the value of numValue is 22? ____________________


2. What is the answer(output)  if the value of numValue is 1? ____________________


3. What is the answer(output)  if the value of numValue is 4? ____________________


4. What is the answer(output)  if the value of numValue is 2? ____________________


5. Is break statement in the default case needed?  Why or why not? Explain.____________________



Part 2. Create a C++ program that will input student’s ID, scholarship code (“A/a-D/d”), units, tuition fee Per unit is 450php and total tuition after adding misc. fee of 1500php and lab fee of 900php and discount.



Scholarship Code                              Description                            Discount


E/e                                                      Regular                                   0%


D/d                                                     Non-Academic                       25%


C/c                                                      Department                           50%


B/b                                                     College                                    75%


A/a                                                      Presidential                           100%



Output their scholarship code and the net tuition fee.



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here