Design a structure in c that contains data to model a state

Assignment Help Computer Engineering
Reference no: EM132104940

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

Reference no: EM132104940

Questions Cloud

Fund managers in endeavors to raise money : What are the major challenges faced by fund managers in endeavors to raise money?
What is the size of the banks actual reserve : If a bank has access reserves of $8000 and checkable deposits of $150000. If the reserve ratio is 20% what is the size of the banks actual reserve?
Describe how use of the net present value technique : Describe how use of the net present value technique would assist the company in coming up with the best investment decision.
Implement the lexical analysis task : Your C++ code should input a text ?le from user, which contains the expressionhe/she wants the compilers to analyze.
Design a structure in c that contains data to model a state : Design a structure in C that contains data to model a state capital and write several functions that process and act on that data.
Write a python simulation to experimentally verify problem : Write a Python simulation to experimentally verify the Monty Hall problem. Your simulation should run a large number of trials for two scenarios.
Why pathology collector should follow communication protocol : CHCCOM005 Communicate and Work in Health or Community Services -HLT37215 Certificate III in Pathology Collection - Why is it important for you to listen
Assign the cost of the copy center to department : How would you assign the cost of the copy center to each department? Why?
How do you prepare flexible expense budget that reflects : How do you prepare flexible expense budget that reflects what each expense should have been for 2016 in the Bellaire Clinical Lab?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd