Write a c program that contains a structure

Assignment Help C/C++ Programming
Reference no: EM132194776

Question: Write a C program that contains a structure that uses predefined types and union.

• Create a struct with name, age, kind (Either child, college student, or adult), and kindOfPerson (Either kid, student, or adult)

• kids have a school field. Students have college and gpa. Adults have company and salary.

• Create one non-dynamic struct with the content for a college student: "Bob", 20, K-State, 3.5

• Create one struct dynamically for a kid with: "Alison", 10, "Amanda Arnold Elementary"

• Implement a function that can be used to display the contents of a single structure

• Print out both structures

• Free up the memory allocated before exiting

Reference no: EM132194776

Questions Cloud

A program to help the administration of a football league : Write a C++ program to help the Administration of a football league to manipulate the list of players registered in different teams.
Write a c program which will flip a single bit in a number : Write a C program which will flip a single bit in a number entered by the user using the binary representation of the number. The user should input the original
A program that initializes an array with ten random integers : Write a C++ program that initializes an array with ten random integers and then prints all elements in two lines of output containing.
Write a program that creates a vector of given elements : Write a C++ program that creates a vector of 15 integer elements. Using an iterator, assign each element a value that is three times of its current value.
Write a c program that contains a structure : Write a C program that contains a structure that uses predefined types and union. Create a struct with name, age, kind (Either child, college student, or adult)
A c program that will check the current setting of echo : Write a C program that will check the current setting of "echo". It it is on, display the message and turn it off.
Write a program to create two files : Write a C++ program to create two files named abc.txt which contains the text I love C++ Programming and def.txt which contains the text.
A program for the frequency histogram : Write a C++ program (c++14). ask the user give some inputs. and then output the frequency histogram of them.
Write a c program that defines a data type : Write a C program that defines a data type (structure ) called course which includes the following fields on Computer Science courses.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  An evaluation of blogger

*An evaluation of Blogger *Identify and discuss the online blogs you examined and their usefulness Discuss the place blogging holds in today's availability of information, *and its advantages/disadvantages over more traditional formats such as newspa..

  1 implement the tronomino tiling algorithm your program

1. implement the tronomino tiling algorithm. your program should take an arbitrary input positive integer k in the

  Design a class named pet

Design a class named Pet, which should have the following fields: Name - The name field holds the name of a pet. and Type - The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird"

  Define the simpleinterestloan class which is a sub class

Define the SimpleInterestLoan class, which is a sub class of the Loan class. When the user enters a non-numeric value in any of the three TextBox controls, your program is going to throw an exception when the value is converted into a number.

  Develop code for the file-oriented input or output driver

CMPSC311- The bulk of this assignment is to develop code for the file-oriented input/output driver that uses the object store. Conceptually, you are to translate each of the below file I/O function calls into calls to the previously described CRUD..

  Write a program to read vehicles speed

Write a program to read vehicles speed, travel time and the vehicles MPG, calculate distance traveled and the number of gallons used.

  Writing a program to handle the billing of electricity

CSCI251 - Advanced Programming - Writing a program to handle the billing of electricity, gas and phone accounts of a meter reading and billing company

  Create a ruby script that defines a function

Create a Ruby script that defines a function occurrences(list,key) that takes an array list and object key and returns the number of elements in list that are equal to key - Create a Ruby script that defines a function numSmaller(list,item) that t..

  Numbers until the user wants and in the end display

Write a C program to enter the numbers until the user wants and in the end display the product of numbers entered by the user. The program should terminate once the user enters the character 'n' and continue computing product if user enters 'y'

  Functionality in the application

When the application starts, it should display a message asking the user to enter either option d or v. The application should execute the following actions for the two options: d: The application should display the file extension of the stock det..

  What are the contents of the array

What are the contents of the array after the subsequent loops complete - loops and also provide the iteration how to get it.

  What system or application you wish to develop motivations

A project proposal (1-2 pages) outlines what system or application you wish to develop, the motivations or aims, user requirements or required functions, system structures and a rough plan. What you need to submit is a standalone Word or PDF file...

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