Based on the given class definition, correction and implementation procedures, code and results diagram
//1, there is an abstract class Movie, have public actors actorName and read-only private attribute name, an abstract method toString returns a string information
The class Movie
{
public String name;
Public String actorName;
String Movie (String name) {
Name=name;
}
Void getName (String name) {
Name=name;
}
}
//2, there is a kind of Cartoon, from the Movie class inheritance, have public property price price and rating score,
The class Cartoon
{
A double score
Double price.//price
String toString ()
{
This. The name "get" + this. Score;
}
}
//3, there is a public class Citizen, with read-only attribute student id id and the name of the read-only attribute name, a public methods tickets purchased cartoon the sum of the total value of the method and statistics,
//4, randomly generated 10 (course name "cartoon + random number", the price of 20 ~ 40) cartoon, there is a citizen choose three, statistical sum,
//5, perfect the program realization of citizens from the cinema movie ticket information, print information, (100)
The output format: movie name 1, grade 1, the price is 1
Movie name 2, grade 2, the price is 2
Movie name 3, grade 3, the price of 3
Statistics: mean score, total prices