Programming Exercise 4 Assessment component B Weight 18 from 60 This exercise is designed to assess student's skills of writing programs using arrays and loops. Exercise 4.1: Write a program to define an integer array, store 10 integers in array. Input a number from a user, find this number in array and display "Number Found" if number matches a number in array or display "Number Not Found", if number does not match. Also, display position of the found number in array as well Exercise 4.2: Write a C++ program for a number Find ME game. The user will input 15 different integer numbers. The program will find if the input number is already existing or inputted in the array, display "The number
already exists!", otherwise your program will ask another value. Then the user will input another number. Your program will find the nearest value/s (next and back) in the array with following criteria's • if entered number doesn't exist, display "The input number does not exist and ask again to enter number. • if the entered number is the last number in the array display only back number and for next display "The input number is last number so no next number exist" same like that for first number in the array Sample input/Output: Input value 1: 13 Input value 2:18 Input value 3: -9 Input value 4:1 Input value 5:0 Input value 6:15 The number already exists! Input value 6:10 Input value 7: -34 Input value 8: 76 Input value 9: 8 Input value 10:100 The number already exists! Input value 10: -7 Input value 11:25 Input value 12:37 Input value 13:49 Input value 14:45 Input value 15: -20 Input number to find: 17 The input number does not exist Input number to find: 49 Back number: 37 Next number: 45
If Input number to find: -20 Back number: 45 Next number: The input number is last number so no next number exist If Input number to find: 13 Back number: The input number is first number so no last number exist Next number: 18 Note: You must demonstrate the use of arrays and loops. Your code must be properly commented.
Programming Exercise 4 Assessment component B Weight 18 from 60 This exercise is designed to assess student's skills of
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Programming Exercise 4 Assessment component B Weight 18 from 60 This exercise is designed to assess student's skills of
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!