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