Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


please review it and correct it 

#include <iostream>

using namespace std;


main()
{
int typ;
int unit;
int cus_nub;
int days,bill;

cout "1-----------Domectice User:";
cout "2-----------Commercial User:\n";
cout "Please Choose your chpice From the Above menu:\n";
cin>> typ;

switch (typ)

{
case (typ == 1):


cout "Please enter the customer number:";
cin>>cus_nub;
cout "Please enter unit consumed:";
cin>>uint;
cout "Please enter number of days:";
cin>>days;
if ( uint 100=<, )
{
bill=uint * 5 }
else if (unit 101=> && =>300)
{ bill = ((uint*8)+100)
}
else if (uint 301=> && =>500)
{ bill = ((unit * 10) + 230)}
}
break;
case (typ == 2)
cout t "Please enter the customer number:";
cin>>cus_nub;
cout "Please enter unit consumed:";
cin>>uint;
cout "Please enter number of days:";
cin>>days;
bill = uint*15
}}

if (days 11=>)
{ bill = bill +200 }
cout " Aount to be paid by te custoer No."cus_nub "is" bill n/;


break;
default:

cout "invalid entry\n";
break;}

}
)

Views: 2503

Replies to This Discussion

qaiser abbas gud & thanks 

cs201..solution

Attachments:

this is above corrected assignment

this is completely correct

#include <iostream.h>
float dom_user(int,int,int);
float com_user(int,int,int);
main()
{
int typ;
int unit;
int cus_nub;
int days;
cout"1-----------Domectice User:\n";
cout"2-----------Commercial User:\n";
cout"Please Choose your choice From the Above menu:";
cin>> typ;
while(typ<1000)
{
cout"Please enter the customer number:";
cin>>cus_nub;
cout"Please enter unit consumed:";
cin>>unit;
cout"Please enter number of days:";
cin>>days;

switch(typ)
{
case 1:
dom_user(cus_nub,unit,days);
break;

case 2:
com_user(cus_nub,unit,days);
break;

default:
cout"invalid entry\n";
}
system("pause");
}
}
float dom_user(int cus_nub,int unit,int days)
{
float bill;
if(unit<101)
{
bill=unit * 5;
}
else if(unit>101 && unit<301)
{
bill = ((unit*8)+100);
}
else if(unit>301 && unit<501)
{
bill = ((unit * 10) + 230);
}
cout" Amount to be paid by te custoer No."cus_nub"is" bill"\n";
}
float com_user(int cus_nub,int unit,int days)
{
float bill;
bill = unit*15;
if(days>10)
{
bill = bill +200;
}
cout" Amount to be paid by te custoer No."cus_nub"is" bill"\n";
}

 ash gud & thanks 

Note @ All: You don’t need to go any other site for this assignment/GDB/Online Quiz solution, Because All discussed data of our members in this discussion are going from here to other sites. You can judge this at other sites yourself. So don’t waste your precious time with different links.

its coreect

It's wrong as you didn't use the functions

Thanks 

it is not completly correct, program do not exit if we enter any other number except 1 or 2 (user type). it is compulsory .though default : "pause" , is set but i chked it , its realy dont exit .plz look into this matter. i tried to find out the problem but still not,  thanks ash.

i diidnt notice about that no i have changed the above file with correct file

RSS

Looking For Something? Search Below

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

Latest Activity

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service