100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4,6 TrustPilot
logo-home
Other

COS1511 ASSIGNMENT 1 SOLUTIONS 2021

Rating
-
Sold
1
Pages
15
Uploaded on
22-05-2021
Written in
2021/2022

COS1511 ASSIGNMENT 1 SOLUTIONS 2021. Fully detailed code included and was done in word. Really good marks guaranteed.










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

Document information

Uploaded on
May 22, 2021
Number of pages
15
Written in
2021/2022
Type
Other
Person
Unknown

Subjects

Content preview

COS1511

ASSSIGNMENT 1 SOLUTIONS



QUESTION 1
#include<iostream>

using namespace std;

int main()
{
int mFactor;

//takes input from the user for the value of mFactor
cout<<"Please enter the factor to multiply the ingredients with: ";
cin>>mFactor;


cout<<"\nItalian Noodles Recipe"<<endl;
cout<<"\tIngredients"<<endl;


//Ingredients quantity is multiplied with mFactor wherever a number
appears.
cout<<"\t\t"<<1*mFactor<<" packet of Instant
noodles"<<endl<<"\t\t"<<1*mFactor<<" teaspoon
Oil"<<endl<<"\t\t"<<2*mFactor<<" Garlic Cloves finely
chopped"<<endl<<"\t\t"<<1*mFactor<<" cup Mushrooms
diced"<<endl<<"\t\t"<<1*mFactor/2<<" cup Red Pasta
Sauce"<<endl<<"\t\t"<<1*mFactor/4<<" teaspoon Oregano
dried"<<endl<<"\t\t"<<2*mFactor<<" tablespoons Olives
sliced"<<endl<<"\t\t"<<"A few Basil leaves"<<endl<<"\t\t"<<2*mFactor<<"
tablespoon Cheese grated"<<endl<<"\t\t"<<"Salt to taste"<<endl;


cout<<"\n\tMethod"<<endl;
cout<<"\t\t1. Cook the noodles according to package directions without
the tastemaker/masala."<<endl<<"\t\t2. Drain and set aside."<<endl<<"\t\t3.
Heat oil in a pan and add garlic. Saute for a minute."<<endl<<"\t\t4. Now
add mushrooms and cook the mushrooms for two minutes."<<endl<<"\t\t5. Now,
add pasta sauce, oregano and the noodles."<<endl<<"\t\t6. Bring this to a
quick simmer and switch off the flame."<<endl<<"\t\t7. Top with olives,
basil and cheese. Serve immediately.";


return 0;
}
Output:

, QUESTION2
using namespace std;

int main()
{
//Variables declared
int nrPupils,nrGroups,nrLeft,groupSize;
nrPupils=56;

//Input statement
cout<<"Please enter the size of each group? ";
cin>>groupSize;

//Calculate nrGroups and nrLeft
nrGroups=nrPupils/groupSize;
nrLeft=ceil((nrPupils-(nrGroups*groupSize))+((nrPupils/(float)groupSize)-nrGroups));

//Display Result
cout<<"\nThere are "<<nrGroups<<" groups consisting of "<<groupSize<<" pupils"<<endl;
cout<<"There are "<<nrLeft<<" remaining pupils"<<endl;

return 0;
}

**Code ended**

Output:

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.
cilliersfrederick University of Johannesburg
View profile
Follow You need to be logged in order to follow users or courses
Sold
626
Member since
7 year
Number of followers
384
Documents
353
Last sold
2 months ago
Mathsmadeeasy

We supply detail solutions to assignments so that you can understand the theory and the Method about it. So that you can ace the exam. All Unisa students will benefit from our solutions and become masters in the module in no time.

3,3

94 reviews

5
28
4
20
3
16
2
14
1
16

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