Skip to main navigationSkip to main contentSkip to footer
Wiki Cram
  • Home
  • Blog
Wiki Cram

Chapter 5 Coding Checkpoint Ask the user for a number betwe…

Chapter 5 Coding Checkpoint Ask the user for a number between 1-15. Validate if this number is correct using a loop. Write a for loop that will execute the amount of times that the user chose. Write the following code inside this for loop: Generate a random number between 1-100, save it in a variable, and print it. Write conditionals to determine if the number is even or odd. A number is even if is divisible by 2 (use % to determine remainder). If it is even, print even. If it is odd, print odd. Example output:   Enter a number (between 1 and 15): 21 Enter a number (between 1 and 15): 2 Random number: 52EvenRandom number: 13Odd Test your program several times using different input to ensure that it is working properly. Grading Rubric: Take in a number between 1 and 15. Validate that this number is in range. (2 points) Have a for loop that will executes the amount of times that the user specified. (2 points) Generate a random number between 1-100, save it in a variable, and print it. (2 points) Conditionals and even/odd output is correct. (3 points) You do not have errors in your code. (1 point) Note: You can submit the cpp file or you can paste your code into Notepad and save as a txt file to submit.  

Chapter 5 Coding Checkpoint Ask the user for a number betwe…

Posted on: June 6, 2025 Last updated on: June 6, 2025 Written by: Anonymous Categorized in: Uncategorized
Skip back to main navigation
Powered by Studyeffect

Post navigation

Previous Post Extra Credit: For up to 5 extra credit points, write (in Eng…
Next Post Two survey items are shown below: Q1: “Rank these smartpho…
  • Privacy Policy
  • Terms of Service
Copyright © 2025 WIKI CRAM — Powered by NanoSpace