Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code in C Skeleton Code : https://ideone.com/idwowH Question source [1 Excercise 1: Nanotable 1]: http://www.comp.nus.edu.sg/~cs1010/labs/2017s1/lab4/arrays.html Arrays are super confusing!! Please write in some thought processes
Code in C
Skeleton Code : https://ideone.com/idwowH
Question source [1 Excercise 1: Nanotable 1]: http://www.comp.nus.edu.sg/~cs1010/labs/2017s1/lab4/arrays.html
Arrays are super confusing!! Please write in some thought processes to help me learn too. Thank you! :)
1 Exercise 1: Nanotable1 1.1 Learning objectives Enhancing Nanotable0 Problem solving on two-dimensional array. 1.2 Task statement This is an extension of an earlier lab Nanotable 0. Now with arrays, our Nanotable program can be enhanced. Tables of data can be stored as arrays Nanotable1 has the following features (new features highlighted in !!) . The command parsing works as in Nanotable0, which is in a REPL style. Actually this part is given in the skeleton program already . When the input is "help", the help information is printed . When the input is "exit", the loop breaks and the system !! When the input is "insert", the system asks for the input of Then the system waits for input again exits "students ID" and "score". Then the (ID, score) entry will be stored in the system !! When the input is "init", the whole table is emptied !! When the input is "sum", if the table is empty, the system will say that the table is empty; otherwise it will print the sum of all the scores inserted so far. Then the system Waits for input again !! When the input is "ave", it is similar to the case of "sum" but the printed result will be the average of all the input scores . !! When the input is "rank", if the table is empty, the system will say that the table is empty; otherwise it will ask for input of an integer "rank", which should be from 1 to size (the number of existing entries in the table). If "rank" is out of this range, then print error information and ask for input of rank again. If "rank" is within this range, then print the ID and score of the entry with the rank-th entry in the table. (All the entries in the table are ordered in this way: entries with lower score have lower rank; for entries with same scores, those with smaller ID number have lower rank. It is assumed that all the inserted data has distince ID numbers.)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started