问题描述
编写一个程序,创建一个由教授姓名,教授ID和三个评级组成的ProfessorRating课程。这三个评级用于评估容易度,有用性和清晰度。包括适当的属性。在构造对象后不允许更改ID。在ProfessorRating类中提供一种方法来计算并返回总体评级平均值。打印所有评级和平均评级,格式为实现类小数点右边没有数字。在单独的实现类中,允许用户输入值。使用单个类方法输入所有数据。通过调用构造函数来创建类,以创建ProfessorRating类的实例。
我尝试过:
Write a program that creates a ProfessorRating class consisting of professor name, professor ID, and three ratings. The three ratings are used to evaluate easiness, helpfulness, and clarity. Include appropriate properties. Do not allow the ID to be changed after an object has been constructed. Provide a method in the ProfessorRating class to compute and return the overall rating average. Print all ratings and the average rating formatted with no digits to the right of the decimal from the implementation class. In a separate implementation class, allow the user to enter the values. Use a single class method to enter all data. Test the class by invoking the constructors to create instances of the ProfessorRating class.
What I have tried:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Chapter4PA2
{
class ProfessorRating
{
int IdNo, EasinessRate, HelpRate, ClarityRate;
string FirstName, LastName;
//constuctors
public ProfessorRating()
{
}
public ProfessorRating(int aIdNo, int aEasinessRate, int aHelpRate,int aClarityRate, string firstname, string lastname)
{
IdNo = aIdNo;
EasinessRate = aEasinessRate;
HelpRate = aHelpRate;
ClarityRate = aClarityRate;
FirstName = firstname;
LastName = lastname;
}
public ProfessorRating(int idNo, int easinessrate, int helprate, int clarityrate)
{
IdNo = idNo;
EasinessRate = easinessrate;
ClarityRate = clarityrate;
HelpRate = helprate;
}
public ProfessorRating(int IDNo)
{
IdNo = IDNo;
}
推荐答案
这篇关于帮我解决问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!