Computers and Technology, 12.08.2020 19:01 lorie76
Define a function SetHeight, with int parameters feetVal and inchesVal, that returns a struct of type HeightFtIn. The function should assign HeightFtIn's data member feet with feetVal and inches with inchesVal.
#include
typedef struct HeightFtIn_struct {
int feet;
int inches;
} HeightFtIn;
int main(void) {
HeightFtIn studentHeight;
int feet;
int inches;
scanf("%d %d", &feet, &inches);
studentHeight = SetHeight(feet, inches);
printf("The student is %d feet and %d inches tall.\n", studentHeight. feet, studentHeight. inches);
return 0;
}
Answers: 3
Computers and Technology, 22.06.2019 10:40
Program using c++ only on visual studio pig is a simple two player dice game, played with one die. the first player to reach or surpass 50 is the winner. each player takes a turn rolling the dice. they add to the pot with each roll, having to decide to roll again and increase the pot, or cash out. the risk being they could lose the amount theyโve accumulated into the pot. the rules for each playerโs die roll. 1. roll the dice. a. if user rolled a 1, i. the pot gets set to zero ii. the other player goes to step 1. b. a roll of 2-6 is added to the pot. 2. user can choose to hold or roll again. a. choice roll. return to step 1. b. choice hold. i. increment player score by the pot amount. ii. pot gets set to 0. iii. second player gets to roll and goes to step 1. program requirements: โ before each opponent begins โ output the score for the person and the computer. โ output the opponents whose turn is beginning and ask the user to hit enter to continue. โ with each dice roll. โ output the die value, and amount of the round pot. โ if itโs the users roll ask if they want to roll again ( r ) or hold ( h ). your program should allow r, r, h or h as valid input. if input is anything else, ask the user again until valid input is obtained. โ the ai will continue playing until the round pot is 20 or more. โ once a playerโs score is greater or equal to 50 then they have won, it will no longer ask if they want to keep rolling the die or not. โ once there is a winner โ score totals are output along with who the winner was. user or computer โ player is asked if they want to play again y or n. valid input should be y, y, or n, n. โ when a new game starts the starting roll goes to the player that did not roll last. if the user rolled last in the previous game, then the computer rolls first and vice versa. when the program first begins, the player will make the first roll of the first game. development notes : โ you will need a way to roll dice in your program. the rand() function works well, but returns an integer. if we want numbers 0 โ 9 we can get the value modulus 10. โ call srand() with a value to seed it. itโs common to seed it with the current computer clock, include ctime, and then call srand(time(
Answers: 1
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
Computers and Technology, 23.06.2019 16:30
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
Computers and Technology, 24.06.2019 03:30
It is not necessary to develop strategies to separate good information and bad information on the internet. true or false
Answers: 1
Define a function SetHeight, with int parameters feetVal and inchesVal, that returns a struct of typ...
SAT, 04.01.2022 14:00
English, 04.01.2022 14:00
SAT, 04.01.2022 14:00
Advanced Placement (AP), 04.01.2022 14:00
Mathematics, 04.01.2022 14:00
Biology, 04.01.2022 14:00
Mathematics, 04.01.2022 14:00
Chemistry, 04.01.2022 14:00