Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 16, Problem 2E
Finish the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Instructions:
In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age and a character value for its gender. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter. In the main(), there are two Persons already created: one Male Person and one Female Person.
Your task is to first ask the user for the age of the Male Person and the age of the Female Person.
Then, define and declare a function called createKidPerson() which has the following definition:
Return type - Person
Name - createKidPerson
Parameters
Person father - the father of the kid to be created
Person mother - the mother of the kid to be created
Description - creates a new Person and returns this. The age of this Person will be set to 1 while its gender will be set based on the rules mentioned above.
Finally, create a new Person and call this createKidPerson() in the main and then pass this newly…
Java programming
Project 1 had all the calculations occurring in the main program. For this project, you are to modularize your program. Use functions as much as you can and use Arrays for your menu.
be sure that the names you come up with for your modules are verbs and follow case conventions. Please do not create a function for every single input or calculation! Programmers group statements together that accomplish one task, such as getting input from the user and name them appropriately, such as getInput. Make sure every input display cost or money owed. The results of running your program should be identical to the results you obtained in Project 1 (either your original version or a corrected version if there were errors). If the money given is not enough, make sure you loop back or with decision structure to ask for more money.
This is project 1:
// Project 1
//// This program is designed to take a customers food order and generate a recipt displaying their purchase, the…
In C programming language write
Task 2: Hangman gameWrite a terminal based on the game of Hangman. In a hangman game, the player is given a wordthat they need to guess, with each letter of the word represented by an underscore/blank. Theplayer tries to guess a letter of the word by entering it into the terminal. If the letter is correct, theblank corresponding to that letter is filled in. If the letter is incorrect, a part of a stick figure isdrawn. The player has a limited number of incorrect guesses before the stick figure is fully drawnand the game is lost. The player wins the game if they guess all the letters of the word before thestick figure is fully drawn.The program should have an array of possible words to choose from. A different word should berandomly chosen from the array every time we run the program.Others: Do not use GOTO statements
Chapter 16 Solutions
Programming in C
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Can a subclass ever directly access the private members of its superclass?
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
In what sense are data structures such as arrays, lists, stacks, queues, and trees abstractions?
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Carefully describe the process of program testing.
Problem Solving with C++ (10th Edition)
Write code that opens the file data.txt for both input and output, but first determines if the file exists. If ...
Starting Out with C++ from Control Structures to Objects (9th Edition)
Employee Updater Write a GUI application that allows the user to look up an employee in the Personnel database ...
Starting Out with Java: From Control Structures through Objects (6th Edition)
Suppose a is an array of values of type double. Write some code to display all the elements in a on the screen,...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Design and implement an application that plays the Rock-PaperScissors game against the computer. When played between two people, each person picks one of three options (usually shown by a hand gesture) at the same time, and a winner is determined. In the game, Rock beats Scissors, Scissors beats Paper, and Paper beats Rock. The program should randomly choose one of the three options (without revealing it) and then prompt for the user’sselection. At that point, the program reveals both choices and prints a statement indicating whether the user won, the computer won, or it was a tie. Continue playing until the user chooses to stop. Then print the number of user wins, losses, and ties.arrow_forwardC languagearrow_forwardJAVA:arrow_forward
- Fastarrow_forwardThe Spider Game Introduction: In this assignment you will be implementing a game that simulates a spider hunting for food using python. The game is played on a varying size grid board. The player controls a spider. The spider, being a fast creature, moves in the pattern that emulates a knight from the game of chess. There is also an ant that slowly moves across the board, taking steps of one square in one of the eight directions. The spider's goal is to eat the ant by entering the square it currently occupies, at which point another ant begins moving across the board from a random starting location. Game Definition: The above Figure illustrates the game. The yellow box shows the location of the spider. The green box is the current location of the ant. The blue boxes are the possible moves the spider could make. The red arrow shows the direction that the ant is moving - which, in this case, is the horizontal X-direction. When the ant is eaten, a new ant is randomly placed on one of the…arrow_forwardPlease solve this java problem and including the GUI to run it.arrow_forward
- solve in c# using switch casearrow_forwardMindTap: In C#, Write a program named Averages that includes a method named Average that accepts any number of numeric parameters, displays them, and displays their average. Test your function in your Main(). Tests will be run against Average() to determine that it works correctly when passed one, two, or three numbers, or an array of numbers.arrow_forwardFarrell, Joyce. Microsoft Visual C#: An Introduction to Object-Oriented Programming 5. Create a project for a sandwich shop. The project, named SalsSandwiches, allows a user to use a ListBox to choose a type of sandwich from at least four choices (for example, Roast beef). When the user selects a sandwich type, the program should display a second ListBox that contains at least three types of bread (for example, Whole wheat). After the user selects a bread type, the program should display a third ListBox with at least three choices for additions (for example, Lettuce). Display a message on a Label that lists all the chosen options, and make the bread and additions ListBoxes invisible. If the user makes a new selection from the first ListBox with the main sandwich choices, the bread option becomes available again, and if a new bread selection is chosen, the additions option becomes available again.arrow_forward
- python programing: You are going to create a race class, and inside that class it has a list of entrants to the race. You are going to create the daily schedule of three or so races and populate the races with the jockey/horse entries and then print out the schedule. Create a race class that has The name of the race as a character string, ie “RACE 1” or “RACE 2”, The time of the race A list of entries for that race Create a list of of 3 (or 4) of those race objects(races) for the day For the list of entries for a particular race, make a entrant class (the building block of your entrants list) you should have The horse name The jockey name Now you need to Populate the structure (ie set up three races on the schedule, add 2-3 horses entries to each race. You can hardcode the entries if you want to, rather than getting them from the user, just to save the time of making a menu interface and whatnot. Be able to print the days schedule So example output would be…arrow_forwardComputer Science C# Programming Object Orientation Please use Arrays or ArrayLists where appropriate Implement a menu driven program that has some operations for a food truck. A food truck has multiple food items as well as a menu which contains a selection of the food items which will be sold for that day. A maximum of 10 food items can appear on the menu for any day. For each food item keep a code, description, category, price and quantity in stock (code, description and category are not usually changed). Create a comma delimited text file called "items.txt" for 15 or more food items, indicating the item's description, category, price and quantity in stock. Read all the food items from the text file “Items.txt” Display all the food items available for this food truck. Continuously prompt the user for a food item’s code to be placed on the menu until the menu is full or the user enters -1. Note that only food items which have a positive quantity in stock may be added to…arrow_forwardTrue or FalseYou do not have to write the data type for each parameter variable that is declared in a parameter list if they are all of the same data type.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Control Structures - while loop - do-while loop - for loop - Goto - break - continue statements; Author: EzEd Channel;https://www.youtube.com/watch?v=21l11_9Osd0;License: Standard YouTube License, CC-BY