This assignment asks you to list out the Parts and Chapters of a book. The user enters the number of Parts, and then the number of Chapters per Part. The program prints out start and end messages for each Part of the book. Within each Part, a message is printed for each Chapter. It is assumed that every Part has the same number of Chapters. Use "while" loops to do this assignment. A sample: Another sample: Enter number of Parts: 3 Enter number of Chapters: 4 Enter number of Parts: 4 Enter number of Chapters: 2 Begin Part 1 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Begin Part 1 Chapter 1 Chapter 2 End Part 1 End Part 1 Begin Part 2 Chapter 1 Chapter 2 Begin Part 2 Chapter 1 Chapter 2 Chapter 3 Chapter 4 End Part 2 End Part 2 Begin Part 3 Chapter 1 Chapter 2 Begin Part 3 Chapter 1 Chapter 2 Chapter 3 Chapter 4 End Part 3 Begin Part 4 Chapter 1 Chapter 2 End Part 4 End Part 3

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Java

This assignment asks you to list out the Parts and Chapters of a book. The user
enters the number of Parts, and then the number of Chapters per Part. The
program prints out start and end messages for each Part of the book. Within
each Part, a message is printed for each Chapter. It is assumed that every Part
has the same number of Chapters.
Use "while" loops to do this assignment.
A sample:
Another sample:
Enter number of Parts: 3
Enter number of Chapters: 4
Enter number of Parts: 4
Enter number of Chapters: 2
Begin Part 1
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Begin Part 1
Chapter 1
Chapter 2
End Part 1
End Part 1
Begin Part 2
Chapter 1
Chapter 2
Begin Part 2
Chapter 1
Chapter 2
Chapter 3
Chapter 4
End Part 2
End Part 2
Begin Part 3
Chapter 1
Chapter 2
Begin Part 3
Chapter 1
Chapter 2
Chapter 3
Chapter 4
End Part 3
Begin Part 4
Chapter 1
Chapter 2
End Part 4
End Part 3
Transcribed Image Text:This assignment asks you to list out the Parts and Chapters of a book. The user enters the number of Parts, and then the number of Chapters per Part. The program prints out start and end messages for each Part of the book. Within each Part, a message is printed for each Chapter. It is assumed that every Part has the same number of Chapters. Use "while" loops to do this assignment. A sample: Another sample: Enter number of Parts: 3 Enter number of Chapters: 4 Enter number of Parts: 4 Enter number of Chapters: 2 Begin Part 1 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Begin Part 1 Chapter 1 Chapter 2 End Part 1 End Part 1 Begin Part 2 Chapter 1 Chapter 2 Begin Part 2 Chapter 1 Chapter 2 Chapter 3 Chapter 4 End Part 2 End Part 2 Begin Part 3 Chapter 1 Chapter 2 Begin Part 3 Chapter 1 Chapter 2 Chapter 3 Chapter 4 End Part 3 Begin Part 4 Chapter 1 Chapter 2 End Part 4 End Part 3
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning