You are going to create an autogenerated list of numbers. Ask a user for a random number between 1 and 25. Your program must create a list of numbers between 1 and the user-given number. BUT it should only include every second number. Display the list of numbers in a nicely formatted way. The numbers should be seperated by (",")(comma with no spaces)(notice the spaces on each side of the comma) If the user types 19 the program will print: 1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 Use a For loop to answer this question. Do not write a function or procedure. Only write the code. The output must match the above and the test case output formatting. For example Input Result 15 Please enter a number between 1 and 25: 1,3,5,7,9,11,13,15 12 Please enter a number between 1 and 25: 1,3,5,7,9,11 8 Please enter a number between 1 and 25: 1,3,5,7
You are going to create an autogenerated list of numbers. Ask a user for a random number between 1 and 25. Your program must create a list of numbers between 1 and the user-given number. BUT it should only include every second number. Display the list of numbers in a nicely formatted way. The numbers should be seperated by (",")(comma with no spaces)(notice the spaces on each side of the comma) If the user types 19 the program will print: 1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 Use a For loop to answer this question. Do not write a function or procedure. Only write the code. The output must match the above and the test case output formatting. For example Input Result 15 Please enter a number between 1 and 25: 1,3,5,7,9,11,13,15 12 Please enter a number between 1 and 25: 1,3,5,7,9,11 8 Please enter a number between 1 and 25: 1,3,5,7
Chapter8: Arrays
Section: Chapter Questions
Problem 4GZ
Related questions
Question
You are going to create an autogenerated list of numbers.
Ask a user for a random number between 1 and 25.
Your
Display the list of numbers in a nicely formatted way. The numbers should be seperated by (",")(comma with no spaces)(notice the spaces on each side of the comma)
If the user types 19 the program will print:
1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19
Use a For loop to answer this question.
Do not write a function or procedure. Only write the code.
The output must match the above and the test case output formatting.
For example
Input | Result |
---|---|
15 | Please enter a number between 1 and 25: 1,3,5,7,9,11,13,15 |
12 | Please enter a number between 1 and 25: 1,3,5,7,9,11 |
8 | Please enter a number between 1 and 25: 1,3,5,7 |
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,