Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

My program doesn't know how many input values a user will enter (and can't ask how many), so an array can't hold all of them.

My program doesn't know how many input values a user will enter (and can't ask how many), so an array can't hold all of them. I have an array of 10 integers. write the input to a slot and increment it if it's not -1. If incrementing the value puts it beyond the end of the array, set the index of array back to the first slot. If the user input is more than 10 inputs, print only the last 10 inputs. If the amount of inputs is less than ten, and the user types -1, exit the program and output all of those numbers(not -1 though).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions

Question

denigration of emotional outbursts; being reserved;

Answered: 1 week ago