java,wen tiProblem DescriptionA holiday resort has rooms for$200 per night,or if customers stay for 1 or more weeks theyare charged $1200 per week (7 days for theprice of 6).In addition if the customer is amember of an automobile club,they receive an

来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 04:32:22
java,wen tiProblem DescriptionA holiday resort has rooms for$200 per night,or if customers stay for 1 or more weeks theyare charged $1200 per week (7 days for theprice of 6).In addition if the customer is amember of an automobile club,they receive an
xUn0~iLiv6CSҮ&ąfF&qśC 2ރc;Ҫ)mW8$=c{`9Bj^X̕[F93 L><@ 涣4)*GmXzܠJ##s\0:sga 1zZh")K ,˸ qu1OhKΌLt?oBxާ$+8&3%L1QdfTw.˜2G:3|S/ˬsy*Z=ER+Y+cc݉,= g\FWVs9{jkZ5IIuE(Ñ{.\BY6K+dt0)u3Azc0RhU.U0&Eףd4Q :G3&%Q8qب0Q=a8 #bCXj,XvS4F`uհw ݊HZ>fޘ[$}t[*;4< ͘61T[6 znʪvoͬcd!0ٕ"kƗH·Uot7XC O[ߕ^cX;zu1ޖLh]GGn[ڽ48#hV{@__95~

java,wen tiProblem DescriptionA holiday resort has rooms for$200 per night,or if customers stay for 1 or more weeks theyare charged $1200 per week (7 days for theprice of 6).In addition if the customer is amember of an automobile club,they receive an
java,wen ti
Problem Description
A holiday resort has rooms for$200 per night,or if customers stay for 1 or more weeks they
are charged $1200 per week (7 days for theprice of 6).In addition if the customer is a
member of an automobile club,they receive an additional 5% off regardless of the duration
of the stay.Assume that customers stay 1 to 6days or 1 week,2 weeks,…
import java.util.*;
public class ColculateCost
{
public static void main(String[]args)
{
Scanner keyboard=new Scanner(System.in);
System.out.println("Number of Nights?");
int numberNights=keyboard.nextInt();
System.out.println("Member of Auto Club(Y=yes,N=No)?");
char memberAutoClub=keyboard.nextChar();
double cost=0.0;
if(numberNights

java,wen tiProblem DescriptionA holiday resort has rooms for$200 per night,or if customers stay for 1 or more weeks theyare charged $1200 per week (7 days for theprice of 6).In addition if the customer is amember of an automobile club,they receive an
import java.util.*;
public class ColculateCost
{
   public static void main(String[]args)
   {
           Scanner keyboard=new Scanner(System.in);
   System.out.println("Number of Nights?");
   int numberNights=keyboard.nextInt();
   
   System.out.println("Member of Auto Club(Y=yes,N=No)?");
   String memberAutoClub=keyboard.next();
   
   double cost=0.0;
   
   if(numberNights<7)
   {
       cost=numberNights*200;
               }
   else
   {
       cost=numberNights/7*1200;
   }
   
   if("Y".equals(memberAutoClub))
   {
       cost=cost*0.95;
   }
   System.out.println("Cost=$"+cost);
   }
}

好了.