A new member needs answers asap:)

hi all
i need the answers .if u can
im stuck with my hw i have just knew i have one!
it due 10hours from now!
the questions are:

One interesting application of computers is drawing graphs and bar charts . write a program that reads five numbers ( each between 1 and 30 ).assume that the user enters only valid values . for each number that is read , yor program should print a line containing that number of adjacent asterisks . for example , if your prigram reads the number 7 . it should print *******.
14:-
a mail order house sells fe different products whose retail prices are : product 1__$2.98 , product 2__$4.50 , product3__$9.98 , product 4__$4.49, and product 5__$6.87 . write a program that reads a series of pairs of numbers as follows :
a)product number
b) quantity sold
your program should use a switch statment to determine the retail price for each product . your program should calculate and display the total retail value of all product sold . use a sentinel controlled loop to determine when the program should stop looping and display the final results .

thanx alot :)
Lol.
Should i also do all the error handling and make a neat GUI for this?
Try to find an answer by searching the archives of the forum you plan to post to.
Try to find an answer by searching the Web.
Try to find an answer by reading the manual.
Try to find an answer by reading a FAQ.
Try to find an answer by inspection or experimentation.
Try to find an answer by asking a skilled friend

lol
i 've searched but i didnot foins the answer~!
i dont have skilled friends lol :D

any way if u dont want to help, then why did u make this fourms :)?
I think you missed these:

Try to find an answer by reading the manual.
Try to find an answer by reading a FAQ.
Try to find an answer by inspection or experimentation.


You have no code, so obviously you didn't try reading a manual, reading a FAQ, or trying to do it (*gasp*) yourself.
any way if u dont want to help, then why did u make this fourms :)?


This forum is for those who help themselves and then ask for help. if you straight away come without giving it a try no one is going to help you.
Last edited on
any way if u dont want to help, then why did u make this fourms :)?

http://www.cplusplus.com/forum/beginner/10129/
bazzy that was cool..
how did you follow that link.. :D that was quite old and i saw myself also jumping in that later.. :P hehehehe
how did you follow that link..

I remembered the name of that guy was Gonzosomething so I used the search box of this site and found it
...I have a good memory LOL
Indeed it is.. :)
closed account (S6k9GNh0)
The point of this is learning the lesson the hard way. We aren't here to do your homework for you, we're here to help you learn and experiment with the language. If something doesn't work and you can't figure out why, you can come here and we can work it out. Although if you bring some messed up, trashy piece of crap that looks like you didn't read page 1 of your C++ tutorials, you're bound to: be made fun of, insulted, offend people, and probably get thrown off to the side with no help.

I'm sure they've learned that if we don't do this, nobody will ever learn.
be made fun of, insulted, offend people, and probably get thrown off to the side with no help.


This!
Don't worry there, I got you the solutions:

First question:
#include<iostream>
using namespace std;


void main()
{
int c;
cout<<"Enter a number: ";
cin>>c;

while(c>=1)
{

cout<<'*';

c--;
}

}



********************************************

Second question:

#include<iostream>
using namespace std;


void main()
{
int ProductNumber;
double QuantitySold;
double sum1=0, sum2=0, sum3=0, sum4=0, sum5=0;

cout<<"Enter the product number followed by the quantity sold:";
cin>>ProductNumber>>QuantitySold;

while((ProductNumber>0)&&(ProductNumber<7))
{
switch (ProductNumber)
{
case 1:{
sum1+=(2.98*QuantitySold);
break;
}
case 2:{
sum2+=(4.50*QuantitySold);
break;
}
case 3:{
sum3+=(9.98*QuantitySold);
break;
}
case 4:{
sum4+=(4.49*QuantitySold);
break;
}
case 5:{
sum5+=(6.87*QuantitySold);
break;
}
default:{
cout<<"Invalid Input"<<endl;
break;
}
}

cout<<"Enter the product number followed by the quantity sold:";
cin>>ProductNumber>>QuantitySold;

}

cout<<"The total value of sold products= "<<sum1+sum2+sum3+sum4+sum5<<endl;

}

They should work properly (as I wish), but try to do it by yourself next time, Peace.
void main()


...

but try to do it by yourself next time,


Then why are you supporting this guy if you want him to do it himself?
Last edited on
Don't worry there, I got you the solutions
You should worry if you are given the complete solution to your homework as you won't learn anything out of that
closed account (S6k9GNh0)
I bet you twenty bucks he, compiles it and tests it, and then turns it in just like that, that is if he tests it at all. Since it was due 10 hours from this post, he could've spent that time understand a little bit of C++ and in about an hour or so or straight studying would have easily have known enough to do most of it himself, not to mention that his teacher probably taught him everything he needed to know for this assignment. He should worry especially since he won't know wtf he's doing on the next assignment.
Last edited on
well first ,im a girl :)
my doctor is so dumb
he doesnot understand what he teachs!
when i ask him questions he says ask the TA!
im studing Engineering ,and computer engineering is not my major!so why would i need that!

----
SLF91RAB
thanx alot for the answers but i got them from my friend's friend:P

i understood the material till the "object s"
:)
Lets end it here.. :)
Topic archived. No new replies allowed.