Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program. In 2015 Earth is in ruins and there are sand storms everywhere. Nothing grows, so humanity is lack of food. A

Write a C program.

In 2015 Earth is in ruins and there are sand storms everywhere. Nothing grows, so humanity is lack of food. A secret and small group of MUMUCA scientists find 6 or 8 faraway planets to search for life. And this team made only one spaceship to explore those planets due to limited sources of Earth. MUMUCA selected YOU for that brave mission and send you to space with full fuel tank (Even though you have no experience on flying spaceship ). Now you have a spaceship to explore those planets to find habitable life. If you find a habitable planet you can choose to live there and let the humankind die in earth or you can return to earth if you have enough fuel. All humankinds fate is up to you, spend your resources wisely. Also calculate the passed time on earth with respect to planets time constraints.

Habitable life assignment:

At the start of the game habitable life must be assigned to random planet.

Time pass circumstances

There two type of time pass circumstances.

  1. Travelling time between planets

It depends on the distance between planets. All planets on a linear platform and they have their coordinates on this linear platform. Every light year distance between planets are counted as 1 Earth day.

Earth

Planet

1

Planet

2

Planet

3

Planet

4

Planet

5

Planet

6

Planet

7

Planet

8

1

30

210

270

72O

610

580

790

X

  1. Time spent in planets

In every planet you have a different quest. Depending on your answer time/repetition you will spend time in that planet. Generally every repetition

counted as hour on that planet (Further information is on Quest title). Also every planet has different time factor.

Planet

Time Factor (Hour Based)

Earth

1

Planet

60000

Planet 2

20000

Planet

12OOOOO

Planet z

35000

Planet

100000

Planet 6

X

Planet 7

Y

Planet 8

Z

For Example. 1 hour in XPLANET can be equal to 5 year in earth. Therefore if you spend 10 day in x planet your son will be older than your dad.

For guests:

Planet 1: Guess a number game: user selects a number between1and 10 until he find the selected number from computer at random. Also computer helps user by saying whether selected number is higher or lower. Each guess will be counted as one hour in that planet.

Planet 2: Evil Guess a number game: Like first planet user selects a number but this time, its between and zo and computer is evil. At a chance of 50 % computer helps user wrongly. For example. Selected number: 15;

User guess: 10;

Computer may say Guess lower number with a 0/oso chance.

Like first example each guess will be counted as one hour in that planet.

Planet 3: Cumulative Addition: Computer selects a number between 7 and 23at random. User will only add 2, 3 or 5 numbers to reach that num.

For example: To reach 14:

User will enter 5 5 2 2 (2 input).

Also he can entCF 2 2 2 2 2 2 2 (7 input) Or 3 3 3 3 2 (5 input)

lf use passes the selected number computer will select another number and game will continue. If user reaches the selected number, like other planets inputs will be counted as one hour in that planet.

Planet 4: Super Duper Master Dice Roll Championship: For this game, computer will challenge user with Best of 3 dice roll match. Dice has 6 face, 1 from 6 and every dice roll will be decided randomly. For each match computer and user roll the dice for 1 time and the highest value wins the game. If computer wins 2 times in best of 3 series, user lose and rematch will be made..(Draws does not count)If user wins 2 times in best of 3 series match ends. Each roll of dice will be counted as one hour in that planet. (Yes draws also counts as a hour)

For example. User rolled 2 computer rolled 1 user won first game.

User rolled 2 computer rolled 2 draw nothing happened.

User rolled 4 computer rolle d 5 computer won second game.

User rolled 3 computer rolled 2 user won third game.

User win the match total dice roll is 4.

Planet 5: Rock&Paper&Scissor (Roshambo): For this game, computer will challenge user with Best of 3 Roshambo match. There is 3 possibility for this game and Computers selections will be decided randomly. For each match computer and user select a move and the superior one wins the gam(Draws does not count paper -paper, scissor-scissor, rock rock). If computer wins 2 times in best of 3 series , user lose and rematch will be made. If user wins 2 times in best of 3 series match ends and each move of user will be counted as one hour in that planet. (Yes draws also counts)

For example: Rock: 1; Paper: 2; Scissor:3

User selected 1 computer Selected 1 Draw User selected 1 computer Selected 3 User Won

User selected 2 computer Selected 3 Computer Won

User selected 2 computer Selected 1 User Won User win the match total move is 4.

Planet 6 : Binary-Decimal / Decimal Binary . Between o and 255 a number will be decided randomly by computer. Then asks to user 3 times a random digit of binary value of the that number. If user enters wrong number for a digit program will select another random number and ask random times random digit. Every time user enters input will be counted as one hour in that planet.

For example: Computer selected number as163 ( Which is10100011)

What is the digit 2 (question 1/ 3): User enter 1 Correct

What is the digit 4 (question 2/3): User enter o Correct

What is the digit 7 (question 3/3) : User enter o correct

User finished the quest with 3 input .

Planet 7: Fast Multiplier : Computer generates 2 number between 10 and 30 and asks to user; multiplication of those 2 numbers. A timer starts when the question is asked and it will stop when the user answers the question. If the answer is false program asks another multiplication question. If the answer is true , program will take the duration as seconds and converts every second passed to hour in that planet.

For example: What is 12* 12?

User enter 144

Correct you spent z seconds for that question which is 2 hours on this planet

Fuel Consumption:

You will burn fuel with respect to distances between planets. You have fuel enough to go 50000 light year distance. If you are out of your fuel the game ends.

Game ending:

Game will be finished if you find a habitable planet or you are out of fuel. In both cases you have to prompt to screen how much the time passed on earth in years.

#include #include

int calculateDistance(int firstPlanet, int secondPlanet) { int distance = firstPlanet - secondPlanet; if (distance < 0) { distance = -distance; } return distance; }

bool canTravel(int fuel, int distance) { return (fuel >= distance); }

int planet1() { int planetHour = 0; int number; int computerNumber = 8; do { printf("Select a number between 1-10"); scanf_s("%d", &number); if(computerNumber > number) { printf("Guess a higher number "); } else { printf("Guess a lower number "); } planetHour++; } while (number != computerNumber);

return planetHour; }

void main() { int distances[] = {1, 30, 210, 270, 720, 610, 580, 790}; int fuel = 50000; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

More Books

Students also viewed these Databases questions

Question

define the term outplacement

Answered: 1 week ago

Question

describe the services that an outplacement consultancy may provide.

Answered: 1 week ago