100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS1511-Introduction To Programming 1 Assignment 4 Semester 1 & 2 2021 [UPDATED ASSIGNMENT].

Rating
-
Sold
-
Pages
29
Grade
A+
Uploaded on
02-09-2022
Written in
2022/2023

COS1511-Introduction To Programming 1 Assignment 4 Semester 1 & 2 2021 [UPDATED ASSIGNMENT]. QUESTION 1: WHILE LOOP and SWITCH QUESTION 1a A valid selection must be between 0 and 4. Enter the program below and complete the while loop. Name the program , compile and run it. + output: #include <iostream> #include <iomanip> using namespace std; int main() { // Fill in the code to define an integer variable called selection int selection; cout << "Please enter the choice of ticket " << "(a number from 1 to 4 or 0 to quit) " << endl; cout << "Ticket Menu " << endl << endl; cout << "1: Exclusive VIP area A " << endl; cout << "2: VIP area B " << endl; cout << "3: Elevated area " << endl; cout << "4: General area R600 " << endl; cout << "0: QUIT " << endl <<endl << endl; cin >> selection ; while (selection <0 || selection >4)//complete the condition { cout << "Invalid choice - Please re-enter: "; cin >> selection; } cout << "You have selected option number " << selection; return 0; } Downloaded by: CloudAcademy | Distribution of this document is illegal S - The study-notes marketplace COS1511 ASSIGNMENT 4 YEAR 2021 UNIQUE NUMBER: PROPERTY OF CLOUD 9 TRAINING ACADEMY P a g e | 5 Downloaded by: CloudAcademy | Distribution of this document is illegal S - The study-notes marketplace COS1511 ASSIGNMENT 4 YEAR 2021 UNIQUE NUMBER: PROPERTY OF CLOUD 9 TRAINING ACADEMY P a g e | 6 + output: #include <iostream> #include <iomanip> using namespace std; int main() { // Fill in the code to define an integer variable called selection int selection; float VIP_areaA = 3000.00; float VIP_areaB = 2000.00; float elevated_area = 1200.00; float general_area = 600.00; float cost = 0.00; int number = 0; //number of ticket cout << "Please enter the choice of ticket " << "(a number from 1 to 4 or 0 to quit) " << endl; cout << "Ticket Menu " << endl << endl; cout << "1: Exclusive VIP area A " << endl; cout << "2: VIP area B " << endl; cout << "3: Elevated area " << endl; cout << "4: General area R600 " << endl; cout << "0: QUIT " << endl <<endl << endl; cin >> selection ; while (selection <0 || selection >4)//complete the condition { cout << "Invalid choice - Please re-enter: "; cin >> selection; } cout << "You have selected option number " << selection <<endl; cout << "How many tickets would you like?" << endl; cin >> number; // Fill in the code to read in number switch (number)// Fill in the code to begin a switch statement // that is controlled by selection { case 1: cost = number * 3000; cout << "The total cost is R " << cost << endl; break; case 2: cost = number * 2000; // Fill in the code for the case VIP area B ( R2000.00 each) cout << "The total cost is R " << cost << endl; break; case 3: cost = number * 1200;// Fill in the code for the case Elevated area (R1200.00 each) cout << "The total cost is R " << cost << endl; break; case 4: cost = number * 600;// Fill in the code for the case General area (R600.00 each) cout << "The total cost is R " << cost << endl; break; case 0: cout << " Please come again" << endl; break; default:

Show more Read less










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
September 2, 2022
Number of pages
29
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COS1511 Assignment 4 Semester 1
& 2 2021 [UPDATED ASSIGNMENT]

written by

CloudAcademy




www.stuvia.com



Downloaded by: CloudAcademy |
Distribution of this document is illegal

, Stuvia.com - The study-notes marketplace


COS1511 ASSIGNMENT 4 YEAR 2021 UNIQUE NUMBER: 862799




REVISION
ANSWERS
Module Code: COS1511

Assignment number: 04
Unique number:

PROPERTY OF CLOUD 9
862799

Semester: 1&2



TRAINING ACADEMY
Year: 2021


WRITTEN BY



CLOUD TRAINING
ACADEMY



Downloaded by: CloudAcademy |
Page |1
Distribution of this document is illegal

, Stuvia.com - The study-notes marketplace


COS1511 ASSIGNMENT 4 YEAR 2021 UNIQUE NUMBER: 862799




Dear learner, please find the model answers for the study unit:
COS1511, Assignment 4 for Semester 1&2 Year 2021 UNIQUE NUMBER:
862799.

We at Cloud 9 Training Academy offer expert Training/Facilitation
/Supplementary notes and study material/Model Answers/Exam Packs
and much more, all at affordable and reasonable prices for you, the
learner. Our main focus is on you as the learner, we also offer guidance
and one-on-one tutoring sessions (depending on your location). Please
email us directly at if you are unable to purchase
from the site directly.

CONTACT: for any issues or questions




PROPERTY OF CLOUD 9
COPYRIGHT AND DISCLAIMER:

Copyright: purchase of a document from this site grants you a limited licence to use the
copyright in such document. Ownership of all copyright remains with the owner and creator


TRAINING ACADEMY
of such documents (Cloud 9 Training Academy). No document or part of a document may be
reproduced, marketed, offered or sold through any internet site, mobile application or other
channel or avenue, nor used in any way that competes with the business conducted by
Cloud 9 Training Academy. Using any such document in a way that is not intended or
permitted by Cloud 9 Training Academy constitutes breach of copyright and automatically
bears legal implications.

All material/model answers/study notes/practice exercises are created and intended for
Studying and Guidance purposes ONLY. Learners will use these model answers to
study/practice and revise. Explanations/Calculations/Solutions/Guidelines and References
have been provided.




Downloaded by: CloudAcademy |
Page |2
Distribution of this document is illegal

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.
Tutorexpert01 Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
1019
Member since
3 year
Number of followers
815
Documents
5654
Last sold
6 days ago
BEST SELLER

Welcome All to this page. Here you will find ; ALL DOCUMENTS, PACKAGE DEALS, FLASHCARDS AND 100% REVISED & CORRECT STUDY MATERIALS GUARANTEED A+. NB: ALWAYS WRITE A GOOD REVIEW WHEN YOU BUY MY DOCUMENTS. ALSO, REFER YOUR COLLEGUES TO MY DOCUMENTS. ( Refer 3 and get 1 free document). I AM AVAILABLE TO SERVE YOU AT ANY TIME. WISHING YOU SUCCESS IN YOUR STUDIES. THANK YOU.

3,9

157 reviews

5
79
4
27
3
21
2
12
1
18

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 exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Frequently asked questions