Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 15:30, ninja12302
Some of the items below indicate the steps required to move a slide to a different location in a presentation. select those steps and indicate the order in which they should be performed to move the slide. (for example, if an item describes what you do first, select 1.) included in the list are items that are not part of the process. for these items, select n/a, an abbreviation for not applicable. 1 — first 2 — second 3 — third 4 — fourth 5 — fifth 6 — sixth n/a — not applicable drag the slide to the desired place. enter the slide position desired. hold the mouse button down. select move from the tools menu. select the slide. switch to the notes view.
Answers: 3
image
Computers and Technology, 22.06.2019 13:30, AsiaDeas4078
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
image
Computers and Technology, 24.06.2019 17:30, NEONREDBLADE
Match the following. 1. formatting that is applied when cell data meets certain criteria 2. borders with formats not found on the border tool 3. a shortcut bar that contains tools for commonly used formats 4. formats that can be applied to numbers conditional formatting custom borders format bar number formats
Answers: 3
image
Computers and Technology, 24.06.2019 18:30, txa95
After making a powerpoint presentation about a new line of clothing designs, henri notices that he used the word “gorgeous” on nearly every slide. what would be the  best  way to add more variety to his wording by using tools within powerpoint? using the thesaurus under the view tab, and then using the find dialog box to find and replace every instance of “gorgeous”using the spelling checker under the view tab, and then using the find dialog box to find every instance of “gorgeous” and change some of themusing the thesaurus under the review tab, and then using the find dialog box to find every instance of “gorgeous” and change some of themusing the spelling checker under the review tab, and then using the find dialog box to find and replace every instance of “gorgeous”
Answers: 2
Do you know the correct answer?
Write a class named book containing: three instance variables named title, author, and tableofconte...

Questions in other subjects:

Konu
Spanish, 06.05.2020 22:09
Konu
Mathematics, 06.05.2020 22:09