| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 319 人关注过本帖
标题:请问下我这个程序要怎么修改才可以增加一个计算的过程。能给个指导么,方程 ...
只看楼主 加入收藏
kofvi
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2011-8-5
结帖率:100%
收藏
 问题点数:0 回复次数:1 
请问下我这个程序要怎么修改才可以增加一个计算的过程。能给个指导么,方程的格式之类的

要求是这样的

Program description:

Develop a program that collects information about a movie and associated rating, calculates and outputs an overall rating as per the Task Description.

You should collect and store the following information from the user:(制定一个方案,收集有关电影和相关的评级的信息,计算和输出作为每个任务的描述的总体评价。

你应该从用户收集和储存以下信息:)

Movie Title
Year released
Publisher
Length (hrs)
Rate the acting (out of 5)
Rate the music (out of 5)
Rate the cinematography (out of 5)
Rate the plot (out of 5)
Rate the duration (out of 5)
Calculate the movie rating using the following:

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
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 output the results a follows:(输出的结果如下)

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.






我写了一部分。但是计算的那部分不知道要怎么写呀。
顺便问问有没有什么不符合要求的地方?
是不是漏了那个什么信息提示informative prompts 呀?要怎么添加了?

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
            movie_title = "Singing Bone";
            year_released = 2010;
            publisher = "Timberlake Productions";
            length = 3.5F;

            // Rating variables
            acting_rating = 4;
            music_rating = 3;
            cinematography_rating = 4;
            plot_rating = 3;
            duration_rating = 2;

            // 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);
        }
    }
}



[ 本帖最后由 kofvi 于 2011-8-9 21:42 编辑 ]
2011-08-09 14:56
kofvi
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2011-8-5
收藏
得分:0 
哪里有写的不对的地方么?求解释啊
2011-08-09 16:05
快速回复:请问下我这个程序要怎么修改才可以增加一个计算的过程。能给个指导么, ...
数据加载中...
 
   



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

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