subject
Mathematics, 12.03.2020 00:03 antoninapride

Write a class named Book containing: Three instance variables named title, author, and tableOfContents of type String. The value of tableOfContents should be initialized to the empty string. An instance variable named nextPage of type int, initialized to 1. A constructor that accepts two String parameters. The value of the first is used to initialize the value of title and the value of the second is used to initialize author. A method named addChapter that accepts two parameters. The first, of type String, is the title of the chapter; the second, is an integer containing the number of pages in the chapter. addChapter appends (that is concatenates) a newline followed by the chapter title followed by the string "..." followed by the value of the nextPage instance variable to the tableOfContents. The method also increases the value of nextPage by the number of pages in the chapter. A method named getPages that accepts no parameters. getPages returns the number of pages in the book. A method named getTableOfContents that accepts no parameters. getTableOfContents returns the values of the tableOfContents instance variable. A method named toString that accepts no parameters. toString returns a String consisting of the value of title, followed by a newline character, followed by the value of author.

ansver
Answers: 2

Another question on Mathematics

question
Mathematics, 21.06.2019 15:30
The table below represents a linear function f(x) and the equation represents a function g(x): x f(x) βˆ’1 βˆ’5 0 βˆ’1 1 3 g(x) g(x) = 2x βˆ’ 7 part a: write a sentence to compare the slope of the two functions and show the steps you used to determine the slope of f(x) and g(x). (6 points) part b: which function has a greater y-intercept? justify your answer. (4 points)
Answers: 3
question
Mathematics, 21.06.2019 19:30
Need now max recorded the heights of 500 male humans. he found that the heights were normally distributed around a mean of 177 centimeters. which statements about max’s data must be true? a) the median of max’s data is 250 b) more than half of the data points max recorded were 177 centimeters. c) a data point chosen at random is as likely to be above the mean as it is to be below the mean. d) every height within three standard deviations of the mean is equally likely to be chosen if a data point is selected at random.
Answers: 1
question
Mathematics, 21.06.2019 20:00
Formulate alisha has a number in mind. if she adds three to her number the result is less than five. use this information to write and solve an inequality about alisha's number. then graph the solution set.
Answers: 1
question
Mathematics, 21.06.2019 23:20
Identify the function that contains the data in the following table: x     -2         0         2         3         5     f(x)     5         3         1         2         4     possible answers: f(x) = |x| + 1 f(x) = |x - 2| f(x) = |x - 2| - 1 f(x) = |x - 2| + 1
Answers: 1
You know the right answer?
Write a class named Book containing: Three instance variables named title, author, and tableOfConten...
Questions
question
Mathematics, 01.07.2021 07:20
question
Mathematics, 01.07.2021 07:30
question
Mathematics, 01.07.2021 07:30
Questions on the website: 13722361