Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

In this problem, you will design a structure in C that contains data to model a state capital and write several functions that process and act on that data. The first step will be to design the StateCapital structure.

Your structure should include the following components: state name, capital name, land area, and date of union entry (the year).

A sample record of Nebraska is like: (Nebraska, Lincoln, 77358, 1867). To make using the webgrader easier for you to use on this program, a psudocode outline is provided for you below so that you know how data is to be inputed into the program.

Basically there will be two loops in the main function. The first is a for loop that lets the user enter a specified number of states that are inputed via the scanf() function from the terminal. Then the program goes into a while loop for a menu that prompts the user for choices involving the other function calls. The program exits the while loop when user selects the "Exit" option.

Implement these functions:

StateCapital *createStateCapital(const char *state_name, int date_of_statehood, const char *capital, double land_area);

StateCapital *findOldestState(StateCapital *stateCapital, int size);

StateCapital *findSmallestState(StateCapital *stateCapital, int size);

StateCapital *findYoungesgtState(StateCapital *stateCapital, int size);

StateCapital *findGreatestLandArea(StateCapital *stateCapital, int size);

StateCapital *findStateCapital(StateCapital *stateCapital, int size, char *stateName);

Structure to use:

typedef struct { char *state_name; int date_of_statehood; char * capital; double land_area; } StateCapital;

Program flow: Begin program: //programer supplied data createStateCapital() createStateCapital() ... 8 //begin webgrader supplied data while true input user-choice if 1 findOldestState() print result end if if 2 findYoungesgtState print result end if if 3 findGreatestLandArea() print result end if if 4 findSmallestState() print result end if if 5 input user-choice findStateCapital() print result end if if 6 break end while memory clean up return End Program

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93092409

Have any Question?


Related Questions in Computer Engineering

As a wealthy graduate of the university you have decided to

As a wealthy graduate of the University, you have decided to give back to the University in the form of a scholarship. You have decided to donate a one-time gift of $500,000 that will be invested at a rate of 5.5% per ye ...

Question an agile-focused mind-set in project

Question: "An Agile-focused Mind-set in Project Management" • Read the following two (2) articles: "The Scrum Guide," located here and "Core Scrum," located here. Contrast the role of a Scrum Master and the role of a pro ...

What are the uses and value of statistical significance

What are the uses and value of statistical significance testing and the p-value as demonstrated in the various analytical techniques (t-tests, ANOVA, chi-square, etc.). What's the fundamental reason we apply these techni ...

These questions are for unix linuxselect the lines from

THESE QUESTIONS ARE FOR UNIX (LINUX) Select the lines from file file1 that have exactly three characters in them. Select the lines from file file1 that have at least three characters in them. Select the lines from file f ...

A compute the sumnbsps1nbsp 1 2 3 nbsp nbsp 9999 the sum

(a) Compute the sum S1 = 1 + 2 + 3 + . . . + 9999 (the sum of all integers from 1 to 9999). Do not use a program. (b) Compute the sum S2 = 1+3+5+...+9999 (the sum of all odd integers from 1 to 9999). Do not use a program ...

Discuss 5 of the most important sql server management

Discuss 5 of the most important SQL Server Management Studio (SSMS) features. Provide references - website link, book, article, etc.

What is the supply curve how do you apply the law of supply

What is the supply curve, how do you apply the law of supply in economics?

Suppose that the demand curve for tickets to see a football

Suppose that the demand curve for tickets to see a football team play a game is given by Q = 80,000 - 40P and marginal cost is zero. The team's stadium can host 75,000 fans. i) How many tickets would the team sell if it ...

Systems analysis and design projectpersonal trainer inc

Systems Analysis and design project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a n ...

Question suppose you are given two circularly linked lists

Question : Suppose you are given two circularly linked lists, L and M. Create an algorithm for telling if L and M store the same sequence of elements (but perhaps with different starting points). It needs to have a main ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As