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

  Calculate the score percentage

If the input value within the valid range, the program will display a "good score" message; otherwise, the program will display an error message and then terminate the program. The program will then calculate the score percentage and then determin..

  Design a program that uses a loop to display

Running on a particular treadmill you burn 3.9 calories per minute. Design a program that uses a loop to display the number of calories burned after 10,15,20,25,30 minutes?

  Write definitions of the functions to overload the operators

Write the definitions of the functions to overload the operators defined in parts a to c and write  a  test  program  that  tests  various  operations  on  the class rectangleType.

  Write recursive and iterative versions of functions

Write recursive and iterative versions of functions that compute the sum of components of an array.

  Dynamically allocate memory for new class objects

This lab will explore the use of pointers in several ways. Pointers will be used to dynamically allocate memory for new class objects on demand from the user, and they will be used to access class-member functions

  Calculates the average of numbers

Write a C program which takes n number of element from user (where, n is specified by user), stores data in an array and calculates the average of those numbers. Output of the program should look like this;

  Pixels down the right of the window

The blue and red values of the pixels across the top of the window are all the same, where the blue is at its maximum value while red is at its minimum value. The green values of the pixels down the right of the window are all the same, where gree..

  Write the definition of a function max

Write a statement that declares a prototype for a function add , which has two int parameters and returns an int .

  Write the decimal equivalents for these ieee floating point

Write the result of the following addition as both 8-bit binary and decimal numbers. For each part, use standard binary

  Implement the readlog function

Implement the readLog function below, which is to (1) read the file, (2) populate a vector for each column, and (3) return the number of lines found.

  Write a loop that will step through the array

Write a loop that will step through the array you defined in question 1, displaying the contents of each element that doesn't contain a NULL pointer

  Program that prints the statement

Write a program that prints the statement "Learning new topics is Fun!" in a function called writeThoughts that is called by the main function.

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