100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
29
Cijfer
A+
Geüpload op
03-09-2022
Geschreven 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: P a g e | 7 cout << "Invalid selection"; cout << " Try again please" << endl; } return 0; }

Meer zien Lees minder
Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
3 september 2022
Aantal pagina's
29
Geschreven in
2022/2023
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

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

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
EXCELLENTNURSE Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1201
Lid sinds
3 jaar
Aantal volgers
989
Documenten
5542
Laatst verkocht
2 weken geleden
TOP 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

167 beoordelingen

5
93
4
23
3
21
2
6
1
24

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen