Write a program that asks the user to input one number at a time and then the program should add the number to previous sum. If the user enters -1, then no more addition is to be done. All these numbers along with the sum value are to be stored in the file.Once this is done, user will enter value of n, the program should be able to display which was the nth number entered and what was the sum at that time?

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
100%

Write a program that asks the user to input one number at a time and then the program should add the number to previous sum. If the user enters -1, then no more addition is to be done. All these numbers along with the sum value are to be stored in the file.Once this is done, user will enter value of n, the program should be able to display which was the nth number entered and what was the sum at that time?

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
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