The purpose of this problem is to use graphic user interface (GUI) to interactively store grades...

50.1K

Verified Solution

Question

Mechanical Engineering

The purpose of this problem is to use graphic user interface(GUI) to interactively store grades in a text file, rather thanadding them manually to a script. Follow these steps to completethe program:

Step 1. Use a question dialog box and ask the user “Do you wantto run this Program?” with two options for “yes” and “no”. If theuser’s answer is “yes”, go to the next step, otherwise, go to Step6.

Step 2. Create a file using fopen command to store the data.

Step 3. Use a while loop and create an input dialog box similarto that of Figure 1 inside the loop.

Step 4. Every time that the users enters the values, checkwhether the grade is -1 or not. If the grade is not -1, store thename, student ID, and grade in one line in the file using fprintfcommand. If the Student ID was shorter or longer than 7 digits, anerror dialog box should appear and give an appropriate errormessage and display a fresh input dialog box. If the entry wascorrect, make sure to separate the data at each line by usinghorizontal tabs (this can be done by typing \t in the fprintfargument). Remember that the output of an input dialog box is acellular array and you have to convert it into a string (by usingcurled brackets to access a specific element of the input dialogresult) before storing it in a file.

Step 5. Close the file.

Step 6. Output a message using a message dialog box indicatingthat the problem is terminated. If you would like to use strcmpfunction, you may.

Step 7. Write the same code in a way that it stores the data inan Excel spreadsheet with proper formatting

Answer & Explanation Solved by verified expert
3.6 Ratings (541 Votes)
    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students