Home > Net >  To solve the
To solve the

Time:09-20

Someone teach me how to do?

CodePudding user response:

 

Bool member
A double purchase amount=0;
The amount of double=0;
A double deal with total=0;
Console. Writeline (" excuse me, are you a member (y/n) ")
If (the console. Readline ()=="y")
{members=true; }
Else if (the console. Readline ()=="n")
{members=false; }
for(int i=1; i<6; I++)
{
Console. Writeline (" please input the price of the {0} goods: ", I);
Total amount of purchase +=double. Parse (console. Readline ());
}
If (the total amount of purchase & gt;
=100){
If (members)
{
* 0.8 total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
The else
{
* 0.9 total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
}
The else
{
If (members)
{
* 0.9 total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
The else
{
Total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
}
Console. Writeline (" the total amount of purchase: "+ total purchase);
The amount of the console. Writeline (" : "+ discount amount);
Console. Writeline (" total payable: "+ cope with total);

CodePudding user response:

reference young programmer 1/f, small don's reply:
 

Bool member
A double purchase amount=0;
The amount of double=0;
A double deal with total=0;
Console. Writeline (" excuse me, are you a member (y/n) ")
If (the console. Readline ()=="y")
{members=true; }
Else if (the console. Readline ()=="n")
{members=false; }
for(int i=1; i<6; I++)
{
Console. Writeline (" please input the price of the {0} goods: ", I);
Total amount of purchase +=double. Parse (console. Readline ());
}
If (the total amount of purchase & gt;
=100){
If (members)
{
* 0.8 total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
The else
{
* 0.9 total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
}
The else
{
If (members)
{
* 0.9 total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
The else
{
Total amount payable=buy;
Discount amount=total amount of purchase - payments;
}
}
Console. Writeline (" the total amount of purchase: "+ total purchase);
The amount of the console. Writeline (" : "+ discount amount);
Console. Writeline (" total payable: "+ cope with total);

I see you many times, greetings from a rookie
  •  Tags:  
  • C#
  • Related