Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is my c language program. Please help me. It is due in 10 hours. Your task: Create a program that prints a class roll

This is my c language program. Please help me. It is due in 10 hours.

Your task: Create a program that prints a class roll sheet in alphabetical order. The user inputs the students' first name and last names (separately!), and presses enter on the first name when done. The program prints out the roster like this...

HATFIELD, HEIDI KAISER, RUSSELL LIPSHUTZ, HOWARD PENKERT, DAWN WRIGHT, ELIZABETH

Before starting, carefully study sort_str(), mod_str(), and format(). Make a copy of sort_str() and rename it roll(). Also, change stsrt() to stsrt2(). Compile and make sure it works from main(). Change limit[] to represent first name. The input should work for 30 students and first name should be 15 characters. Change prompts as needed. Compile and test. Make changes to convert the first name to all upper case using a function from mod_str(). Add another array and get input for last name which will also be an array of 30 with 15 characters. Combine last and first into an third array.

The codes below are just for your reference only. If you could do without them, just fine. In case, if you are wondering where to start, the codes below are just the guidelines.

format()

image text in transcribed

mod_str() program

image text in transcribed

sort_str()

image text in transcribed

1 ?* format.c-format a string */ #include #define MAX 20 4 char sgets (char st, int n); void format (void) char first[MAX]; char last[MAX]; char formal[2 MAX 10]; double prize; 10 puts "Enter your first name:") s gets(first, MAX) puts("Enter your last name:"); s gets(last, MAX) puts("Enter your prize money:"); scanf("%lf", &prize); sprintf(formal, "%s, %-19s: S966 . 2f ", puts(formal); 13 14 15 18 19 20 21 last, first, prize); 23 char s gets (char st, int n) 24 25 26 char ret val; inti- 28 29 30 ret val -fgets(st, n, stdin); if (ret val) else // must have words[i]??0' while (getchar 'n') 35 37 38 continue; return ret val; 40 41 1 ?* format.c-format a string */ #include #define MAX 20 4 char sgets (char st, int n); void format (void) char first[MAX]; char last[MAX]; char formal[2 MAX 10]; double prize; 10 puts "Enter your first name:") s gets(first, MAX) puts("Enter your last name:"); s gets(last, MAX) puts("Enter your prize money:"); scanf("%lf", &prize); sprintf(formal, "%s, %-19s: S966 . 2f ", puts(formal); 13 14 15 18 19 20 21 last, first, prize); 23 char s gets (char st, int n) 24 25 26 char ret val; inti- 28 29 30 ret val -fgets(st, n, stdin); if (ret val) else // must have words[i]??0' while (getchar 'n') 35 37 38 continue; return ret val; 40 41

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

Students also viewed these Databases questions