| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 380 人关注过本帖
标题:c语言初学者,很基础的东西。但是搞不明白想请教。英语的教材。。
只看楼主 加入收藏
kofvi
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2011-8-5
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:1 
c语言初学者,很基础的东西。但是搞不明白想请教。英语的教材。。
    * 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)

Ratings are 0 - very bad to 5 - very good.

After the data has been entered correctly, calculate the overall rating of the movie as follows.

    * 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
这些都是变量。还要定义恒量。然后要求输出的结果是
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
我用visual studio2010做了下。。麻烦各位高人检查下。因为我好像做的是错的。。。

我教程的原文要求是
Write the C# code to perform the following:

    * Define the variables and constants required.
    * Initialise the variables to the values defined in the Task Description example (above).
    * Output the results as 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

Notes :

    * You DO NOT have to provide prompts, looping or any error checking.
    * You DO NOT have to perform any calculations to determine the overall rating.
    * Organise and indent your code.
    * Provide a general comment at the top of the C# file containing your name, student number and student ID.
    * Provide code comments as required.


以下是我做的。。。
namespace Practice_task_2

{
class Program
{
static void Main(string[] args)
{
// declare variable
int Acting_rate = 4;
int Music_rate = 3;
int Cinematography_rate = 4;
int Plot_rate = 3;
int Durating_rate = 2;
string Movie_title = "Singing Bone";
string Year_released = "2010";
string Publisher = "Timberlake Productions";
int Length = 3.5;
// declare constants
Current_year = 2011;
Min_Ratio = 0;
Max _Ratio = 5;

Console.WriteLine("The acting rate is{0}", Acting_rate);
Console.WriteLine("The music rate is {1}",Music_rate);
Console.WriteLine("The cinematography rate {2}", Cinematography_rate);
Console.WriteLine("The plot_rate {3}", Plot_rate);
Console.WriteLine("The Durating_rate {4}", Durating_rate);
Console.WriteLine("Movie title {5}", Movie_title);
Console.WriteLine("Year released {6}",Year_released0);
Console.WriteLine("Publisher {7}", Publisher);
Console.WriteLine("Length {8}", Length);





}
}
}


搜索更多相关主题的帖子: rating 英语 c语言 
2011-08-05 20:59
voidx
Rank: 12Rank: 12Rank: 12
来 自:邯郸
等 级:火箭侠
帖 子:1250
专家分:3538
注 册:2011-4-7
收藏
得分:20 
3 个常量定义不对,输出格式不对~

常量应该是那些单项评分的权:
const float weightActing = 0.25;
...

输出格式按照前面例子里的来

ps:楼主的英语需要加强,Min_Ratio 应该是 Min_Rating。另外要注意代码的风格,_ 和首字母大写不要一起用。c# 一般是用首字母大写,不用下划线,而且变量名的第一个字母一般用小写

啊,还有,c# 和 c 可是两种不同的生物

Console.WriteLine 里没必要用 {0} ~ {8}。这个占位符的编号只在一条 Console.WriteLine 里有意义

[ 本帖最后由 voidx 于 2011-8-5 21:48 编辑 ]
2011-08-05 21:38
快速回复:c语言初学者,很基础的东西。但是搞不明白想请教。英语的教材。。
数据加载中...
 
   



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

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