哪位高人帮帮忙,解决下............

解决方案 »

  1.   

     The program prints the message “This program simulates a swimming
    competition or meet.” to the screen. The program then asks the user the
    following question: “Would you like to continue (yes or no)?”
    o If the answer is “yes” (in either upper or lower case), a simple message
    “Main program code to be inserted here.” is displayed.
    Program execution is then repeated and the user is again asked
    if they would like to continue.
    o If the answer is anything other than “yes”, the program displays
    “Maybe next time. Goodbye.” and exits.The simple message from step 1 “Main program code to be inserted here.” is
    replaced by a series of questions:
    o The user is asked to enter the length of the swimming race. The length
    can be one of the following 50m, 100m, 200m, 400m, 800m or 1500m.
    “Enter the length of the swimming race in metres (50, 100, 200,
    400, 800 or 1500):”
    o The user is asked to enter the names of the competitors in this
    swimming event. The user must enter 11 competitors’ names.
    “Enter a competitor’s name (type “end” to finish):”
    The program then prints a simple message “Code to determine number of
    heats and simulate event to be inserted here.”The simple message from step 2 “Code to determine number of heats and
    simulate event to be inserted here.” is replaced by the code that:
    o determines the number of heats from the number of competitors
    entered;
    o simulates the running of the event and displays heat results to the
    screen;
    o determines the top 3 competitors;
    o awards gold, silver and bronze medals to the competitors with the first,
    second and third best finishing times, respectively.
    When the user chooses not to continue, before exiting, the program will print
    the following messages to the screen:
    o Thank you for using this program.
    XX swimming event(s) were simulated.
    Where XX is the number of times the user has responded with “yes” to the
    “Would you like to continue (yes or no)?” question.Event Length / Stroke / Sex World Record Time
    50m Freestyle Men   21.28
    100m Freestyle Men  47.50
    200m Freestyle Men  1:43.86
    400m Freestyle Men   3:40.08
    800m Freestyle Men   7:38.65
    1500m Freestyle Men  14:34.56
    The maximum of a range is determined by the following equation:
    maximum = worldRecordTimeSeconds + ((eventLength / 50) * 3)
    where worldRecordTimeSeconds is the integer portion of the world record time in
    seconds (ie. the hundredths of a second are dropped).
    Example 1: 400m Freestyle Men:
    maximum = 220 + ((400 / 50) * 3) = 244 seconds (4:04.00)
    Example 2: 1500m Freestyle Men:
    maximum = 874 + ((1500 / 50) * 3) = 964 seconds (16:04.00)
    The minimum of a range is determined by the following equation:
    minimum = wordRecordTimeSeconds - (eventLength / 50)
    Example 1: 400m Freestyle Men:
    minimum = 220 – (400 / 50) = 216 seconds (3:36.00)
    Example 2: 1500m Freestyle Men:
    minimum = 874 – (1500 / 50) = 844 seconds (14:04.00)
    The number of heats in an event can be determined using the following algorithm:
    If ((numCompetitors % numLanes) > 0) then
    numHeats = (numCompetitors / numLanes) + 1
    Else
    numHeats = (numCompetitors / numLanes)
    Where numLanes is 8 for an Olympic (Long Course) Pool. 
       
     
     
       
      

  2.   

    输出结果:
     This program simulates a swimming competition or meet.
     Would you like to continue? (yes or no):no
     may be next time. Goodbye
     
    This program simulates a swimming competition or meet.
     Would you like to continue? (yes or no):yes
    Enter the length of the swimming race in metres (50, 100, 200, 400, 800 or 1500):50
    Enter a competitor's name (type 'end' to finish):end
    You must enter 10 or more competitors
    Enter a competitor's name (type 'end' to finish):Name 1
    Enter a competitor's name (type 'end' to finish):Name 2
    Enter a competitor's name (type 'end' to finish):Name 3
    Enter a competitor's name (type 'end' to finish):Name 4
    Enter a competitor's name (type 'end' to finish):Name 5
    Enter a competitor's name (type 'end' to finish):Name 6
    Enter a competitor's name (type 'end' to finish):Name 7
    Enter a competitor's name (type 'end' to finish):end
    You must enter 10 or more competitors
    Enter a competitor's name (type 'end' to finish):Name 8
      

  3.   

    Enter a competitor's name (type 'end' to finish):Name 9
    Enter a competitor's name (type 'end' to finish):Name 10
    Enter a competitor's name (type 'end' to finish):end
    Event:50 Freestyle Men
    Number of competitors:10
    Number of heats:2
    Competitor 1:Name 1
         Heat time:20.37
    Competitor 1:Name 2
         Heat time:21.12
    Competitor 1:Name 3
         Heat time:24.59
    Competitor 1:Name 4
         Heat time:21.18
    Competitor 1:Name 5
         Heat time:20.10
    Competitor 1:Name 6
         Heat time:20.50
    Competitor 1:Name 7
         Heat time:24.05
    Competitor 1:Name 8
         Heat time:23.25
    Competitor 1:Name 9
         Heat time:23.46
    Competitor 1:Name 10
         Heat time:22.18
    Gold
    Silver
    Bronze
    Would you like to continue? (yes or no):no 
    thank you for using
      

  4.   

    该程序打印的讯息“此程序模拟游泳竞争或满足。 “到屏幕上。然后该计划要求用户的以下的问题: “您是否要继续(是或否) ? ”  o如果回答“是” (在或上或小写) ,一个简单的信息 “主要程序代码插入在这里。 ”显示。   计划的执行,然后反复和用户再次要求如果他们想继续下去。  o如果答案是任何其他“是” ,程序显示 “下一次吧。再见。 “随后退出。   简单的信息,第1步“的主要程序代码插入这里。 ”是取而代之的是一系列的问题:  ö用户要求输入的长度游泳比赛。长度可以是以下50米, 100米, 200米, 400米, 800米或1500米。    “输入长度的游泳比赛中米( 50 , 100 , 200 ,  400 , 800或1500 ) : “  ö用户要求输入的名字竞争对手在这游泳比赛。使用者必须输入11个竞争对手的名字。    “输入一个竞争对手的名称(类型”结束“完成) : ”   程序然后打印一个简单的讯息“守则,以确定人数预赛和模拟活动这里插入。 “   简单的信息,第2步“代码,以确定一些预赛和模拟活动这里插入。 “所取代的代码:  ö确定了若干预赛从竞争者的数目进入;  ö模拟运行的事件,并显示热结果屏幕;  ö确定了前3名竞争者;  ö赔偿金,银,铜奖牌的竞争者第一, 第二次和第三次的最佳整理倍。   当使用者选择不继续,然后,该程序将打印下列讯息到屏幕上:  ö感谢您使用此程序。 第二十条游泳比赛(星期日)进行了模拟。 其中XX是多少次的用户积极响应, “赞成”的 “您是否要继续(是或否) ? ”的问题。事件长度/中风/性别世界纪录 50米自由泳男子21.28  100米自由泳男子47.50 男子200米自由泳1:43.86 男子400米自由泳3:40.08 男子800米自由泳7:38.65 男子1500米自由泳14:34.56 最大射程取决于下列公式: 最高= worldRecordTimeSeconds + ( ( eventLength / 50 ) * 3 ) 在worldRecordTimeSeconds是整数部分的世界纪录时间秒(即在百分之一秒的下降) 。 例1 :男子400米自由泳: 最高= 220 + ( ( 400 / 50 ) * 3 ) = 244秒( 4:04.00 ) 范例2 :男子1500米自由泳: 最高= 874 + ( ( 1500 / 50 ) * 3 ) =九百六十四秒( 16:04.00 ) 最低的范围内确定了下列公式: 最低= wordRecordTimeSeconds -( e ventLength/ 5 0) 范例1 :男子400米自由泳: 最低= 220 -( 4 00/ 5 0) =二一六秒( 3 :36.00) 范例2 :男子1500米自由泳: 最低= 874 -( 1 500年至1 550年) = 8 44秒( 1 4:04.00) 数量预赛中的事件可以决定使用以下方法: 如果( ( numCompetitors % numLanes ) “ 0 ) ,然后 numHeats = ( numCompetitors / numLanes ) + 1 其他的 numHeats = ( numCompetitors / numLanes ) 凡numLanes是8日奥运会(课长)池
      

  5.   

    编个能输出这样的程序:
    This program simulates a swimming competition or meet. 
    Would you like to continue? (yes or no):no 
    may be next time. Goodbye This program simulates a swimming competition or meet. 
    Would you like to continue? (yes or no):yes 
    Enter the length of the swimming race in metres (50, 100, 200, 400, 800 or 1500):50 
    Enter a competitor's name (type 'end' to finish):end 
    You must enter 10 or more competitors 
    Enter a competitor's name (type 'end' to finish):Name 1 
    Enter a competitor's name (type 'end' to finish):Name 2 
    Enter a competitor's name (type 'end' to finish):Name 3 
    Enter a competitor's name (type 'end' to finish):Name 4 
    Enter a competitor's name (type 'end' to finish):Name 5 
    Enter a competitor's name (type 'end' to finish):Name 6 
    Enter a competitor's name (type 'end' to finish):Name 7 
    Enter a competitor's name (type 'end' to finish):end 
    You must enter 10 or more competitors 
    Enter a competitor's name (type 'end' to finish):Name 8
      

  6.   

    Enter a competitor's name (type 'end' to finish):Name 9 
    Enter a competitor's name (type 'end' to finish):Name 10 
    Enter a competitor's name (type 'end' to finish):end 
    Event:50 Freestyle Men 
    Number of competitors:10 
    Number of heats:2 
    Competitor 1:Name 1 
        Heat time:20.37 
    Competitor 1:Name 2 
        Heat time:21.12 
    Competitor 1:Name 3 
        Heat time:24.59 
    Competitor 1:Name 4 
        Heat time:21.18 
    Competitor 1:Name 5 
        Heat time:20.10 
    Competitor 1:Name 6 
        Heat time:20.50 
    Competitor 1:Name 7 
        Heat time:24.05 
    Competitor 1:Name 8 
        Heat time:23.25 
    Competitor 1:Name 9 
        Heat time:23.46 
    Competitor 1:Name 10 
        Heat time:22.18 
    Gold medal:name XX[...]
    Silver medalname XX[...]
    Bronze medal:name XX[...]
    Would you like to continue? (yes or no):no 
    thank you for using