Assignment Write a program that tracks how much book pages the user reads in total in a day and reports if the daily target is reached or not. The program will keep reading int values, each representing pages read during an individual session within a day (pagesRead) until either the user enters 0 or the daily target of 125 pages is met. If the user enters 0, the program should print the remaining pages to the daily target as an int. Otherwise, the program should notify the user has reached the daily target by printing the text "Target is reached in", followed by the number of sessions given as an int, and finally printing the text "session(s)". NOTE: You MUST use a repetitive statement in this question. NOTE: Each pagesRead value MAY also be given as a negative value. These values should simply be skipped without affecting session count. Input 40 20 34 56 5 12 67 567-553 Output Target is reached in Target is reached in 3 5 session(s) session(s) Answer assignment 65

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Assignment
Write a program that tracks how much book pages the user reads in total in a day and reports if the daily target is reached or not. The program will
keep reading int values, each representing pages read during an individual session within a day (pagesRead) until either the user enters 0 or the
daily target of 125 pages is met. If the user enters 0, the program should print the remaining pages to the daily target as an int. Otherwise, the
program should notify the user has reached the daily target by printing the text "Target is reached in", followed by the number of sessions given as
an int, and finally printing the text "session(s)".
NOTE: You MUST use a repetitive statement in this question.
NOTE: Each pagesRead value MAY also be given as a negative value. These values should simply be skipped without affecting session count.
Input
40 20
34 56 5 12 67
567-5 53
Output
Target is reached in Target is reached in 3
5 session(s)
session(s)
Answer assignment
65
Transcribed Image Text:Assignment Write a program that tracks how much book pages the user reads in total in a day and reports if the daily target is reached or not. The program will keep reading int values, each representing pages read during an individual session within a day (pagesRead) until either the user enters 0 or the daily target of 125 pages is met. If the user enters 0, the program should print the remaining pages to the daily target as an int. Otherwise, the program should notify the user has reached the daily target by printing the text "Target is reached in", followed by the number of sessions given as an int, and finally printing the text "session(s)". NOTE: You MUST use a repetitive statement in this question. NOTE: Each pagesRead value MAY also be given as a negative value. These values should simply be skipped without affecting session count. Input 40 20 34 56 5 12 67 567-5 53 Output Target is reached in Target is reached in 3 5 session(s) session(s) Answer assignment 65
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Linux
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning