| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 402 人关注过本帖
标题:麻烦哪位能帮忙看看我写的哪里有错误或者遗漏或多余的地方
只看楼主 加入收藏
kofvi
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2011-8-5
结帖率:100%
收藏
 问题点数:0 回复次数:0 
麻烦哪位能帮忙看看我写的哪里有错误或者遗漏或多余的地方
Your program should display appropriate informative prompts, retrieve the data from the keyboard and store each entry to be used to display output or used to calculate the overall rating.

You should collect and store the movie data from the user using prompts as per the following example :

Enter the following movie data
  Movie Title >
  Year released >
  Publisher > Timberlake Productions
  Length (hrs) >
Rate the following out of 5
  Acting >
  Music >
  Cinematography >
  Plot >
  Duration >

Calculate the movie rating using the following and as per the pseudocode solution :

Rate the acting (out of 5) : 25% of overall rating
Rate the music (out of 5) : 15% of overall rating
Rate the cinematography (out of 5) : 20% of overall rating
Rate the plot (out of 5) : 30% of overall rating
Rate the duration (out of 5) : 10% of overall rating
You should output the results as follows (example only):

Movie Information
Movie Title : Singing Bone
Year released : 2010
Publisher : Timberlake Productions
Length (hrs) : 3.5
Ratings
Acting : 4
Music : 3
Cinematography : 4
Plot : 3
Duration : 2

Overall rating is  7/10 : *******

Express the overall rating as a whole number out of 10 and write the rating as a series of '*' characters.







using System;

namespace practicalTest2
{

    class Program
    {

        static void Main(string[] args)

        {

            // Declare and initialise constants

            const int MIN_YEAR = 1900;

            const int MAX_YEAR = 2011;

         

            // RATING constants

            const int MIN_RATING = 0;

            const int MAX_RATING = 5;

            const float ACTING_PERCENTAGE = 0.25F;

            const float MUSIC_PERCENTAGE = 0.15F;

            const float CINEMATOGRAPHY_PERCENTAGE = 0.20F;

            const float PLOT_PERCENTAGE = 0.30F;

            const float DURATION_PERCENTAGE = 0.10F;


            // Declare and initialise variables

            // Movie variables

            string movie_title = "";

            int year_released = MIN_YEAR;

            string publisher = "";

            float length = 0.0F;


            // Rating variables

            int acting_rating = MIN_RATING;

            int music_rating = MIN_RATING;

            int cinematography_rating = MIN_RATING;

            int plot_rating = MIN_RATING;

            int duration_rating = MIN_RATING;


            // Set test values to variables

            Console.Write("Enter the movie_title > ");
            movie_title = string(Console.ReadLine());  

            Console.Write("Enter the year_released > ");
            year_released = int.Parse(Console.ReadLine());


           Console.Write("Enter the publisher > ");
            publisher = string(Console.ReadLine());
         
            Console.Write("Enter the length > ");
            length = float.Parse(Console.ReadLine());
        


            // Rating variables

           
          Console.Write("acting_rating(the value <=5 and >0) > ");
            acting_rating = int.Parse(Console.ReadLine());
        
            Console.Write("music_rating(the value <=5 and >0) > ");
            music_rating = int.Parse(Console.ReadLine());

             Console.Write("cinematography_rating(the value <=5 and >0) > ");
            cinematography_rating = int.Parse(Console.ReadLine());

             Console.Write("plot_rating(the value <=5 and >0) > ");
           plot_rating = int.Parse(Console.ReadLine());


             Console.Write("durating_rating(the value <=5 and >0) > ");
           duration_rating = int.Parse(Console.ReadLine());

          overall_rating = (acting_rating  * 0.25) + (music_rating * 0.15 ) + (cinematography_rating * 0.2) +
               (plot_rating * 0.3 ) + (duration_rating * 0.1 );
   
         
          overall_rating= Convert.ToDecimal;

            // Output the movie data

            Console.WriteLine("Movie Information");

            Console.WriteLine("Movie Title : {0}", movie_title);

            Console.WriteLine("Year released : {0}", year_released);

            Console.WriteLine("Publisher  : {0}", publisher);

            Console.WriteLine("Length (hrs) : {0}", length.ToString("F1"));

            Console.WriteLine("Ratings");

            Console.WriteLine("Acting : {0}", acting_rating);

            Console.WriteLine("Music : {0}", music_rating);

            Console.WriteLine("Cinematography : {0}", cinematography_rating);

            Console.WriteLine("Plot : {0}", plot_rating);

            Console.WriteLine("Duration : {0}", duration_rating);

            Console.WriteLine("Calculate the overall rating: {0}");
           }         
        
        }


    }


           
搜索更多相关主题的帖子: hrs following keyboard released collect 
2011-08-10 19:57
快速回复:麻烦哪位能帮忙看看我写的哪里有错误或者遗漏或多余的地方
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.050198 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved