Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COS1511 ASSIGNMENT 2, 2019

Rating
-
Sold
2
Pages
11
Uploaded on
11-09-2019
Written in
2019/2020

COS1511 ASSIGNMENT 2, 2019 QUESTION 1: WHILE LOOP AND SWITCH QUESTION 2: FOR LOOP QUESTION 3: NESTED LOOPS QUESTION 4: VOID FUNCTIONS Question 4a Question 4b QUESTION 5: FUNCTIONS WITH ONE OR MORE VALUE PARAMETERS Question 5a Question 5b

Show more Read less
Institution
Course

Content preview

COS1511 ASSIGNMENT 2, 2019
QUESTION 1: WHILE LOOP AND SWITCH
QUESTION 2: FOR LOOP

QUESTION 3: NESTED LOOPS
QUESTION 4: VOID FUNCTIONS

Question 4a
Question 4b
QUESTION 5: FUNCTIONS WITH ONE OR MORE VALUE PARAMETERS
Question 5a

Question 5b


Solution
COS1511 ASSIGNMENT 2, 2019

QUESTION 1: WHILE LOOP AND SWITCH

Question 1a

while (grade != ‘#’ ) // Loop ends when you enter the character ‘#’



Question 1b

Switch (grade) // Switch statement for Char Grade
{
case ‘A’ : // Small case and Upper case entries catered for
case ‘a’ :
cout << “Excellent”;
break;
case ‘B’ :
case ‘b’ :
case ‘C’ :
case ‘c’:
cout << “Well
done”; break;
case ‘D’ :
case ‘d’:
cout << “You passed”
; break;
case ‘E’ :
case ‘e’ :
case ‘F’ :
case ‘f’ :

, cout << “Better try
again”; break;
case '#':
default :
cout << "Goodbye" << endl;
}

QUESTION 2: FOR LOOP

Question 2a : The output will
be: 2
23
305
613
3689

Written for

Institution
Course

Document information

Uploaded on
September 11, 2019
Number of pages
11
Written in
2019/2020
Type
Exam (elaborations)
Contains
Unknown

Subjects

$17.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
StuviaGuides West Virgina University
Follow You need to be logged in order to follow users or courses
Sold
16130
Member since
7 year
Number of followers
8361
Documents
5903
Last sold
2 hours ago
Accounting, Finance, Statistics, Computer Science, Nursing, Chemistry, Biology &amp; More — A+ Test Banks, Study Guides &amp; Solutions

As a Top 1st Seller on Stuvia and a nursing professional, my mission is to be your light in the dark during nursing school and beyond. I know how stressful exams and assignments can be, which is why I’ve created clear, reliable, and well-structured resources to help you succeed. I offer test banks, study guides, and solution manuals for all subjects — including specialized test banks and solution manuals for business books. My materials have already supported countless students in achieving higher grades, and I want them to be the guide that makes your academic journey easier too. I’m passionate, approachable, and always focused on quality — because I believe every student deserves the chance to excel.

Read more Read less
4.3

2291 reviews

5
1568
4
305
3
183
2
74
1
161

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions