$39
Objectives
Introduction: Mission to Mars
Your friend has been playing a new Mars Colony simulator nonstop! They are always talking about how cool it would be if they could be a on the first real-life mission to Mars! To amuse your friend, you have decided to create a series of programs about the possible first colony on Mars.
Problem: Building a Colony (marscolony.c)
Our shuttle of autonomous robots has landed on Mars! And now that the error in the automatic deployment software has been fixed, we can finally deploy our robots to start building our future colony.
There are five critical buildings or infrastructure elements that our colony needs to survive:
Each building or infrastructure element takes about one week to build. Our robots have the ability to build for three weeks without charging. After that, they will need to spend a full week recharging. We have ten weeks total to set up the colony for human habitation.
On Mars, our biggest problem will be the weather. While our autonomous robots are not affected by the cold temperatures, they will have to deal with meteor showers, wind storms, and solar flares. Some buildings and infrastructure elements can be built in adverse weather conditions, while others cannot. For example, our wind and solar farm requires perfect weather to build and set up while water pipes can be constructed in any weather. However, the intense solar flares will rob our robots of all their charge if they are building while it happens. It is not recommended to build during a solar flare unless all the elements for recharging are already in place.
If the colony is complete before the 10 weeks are up, we can stop the mission ahead of schedule and inform mission command that the colony is complete and ready for humans to arrive. If the colony is not complete by the end of 10 weeks, we will have to inform mission command that our colony is incomplete and no astronauts should be sent to Mars at this time.
Program Specification
A skeleton of the solution for this assignment is posted on the webcourse. You must fill in the functions that are currently empty. After you write each function, you should test it before moving on. The main
function should not be modified for the final submission, but you may modify it during testing, provided you return it to its initial form before submitting.
Descriptions of each function are given in the skeleton along with the function Pre- and Post-conditions. Output samples and the output specification are available on the webcourse. These show the wording you should use and how the program should run when completed. Points are allotted for following the precise wording shown.
Input Specification
The user will enter integers in response to menu prompts
Output Specification
Output to the screen. Please see the output specification text document for exact output formats.
Input/Output Sample(s)
Sample input and output files will be provided on the webcourse.
Acceptable Resources
Remember, the use of online help sites is strictly prohibited. The only acceptable resources for these assignments are below:
Course Webcourse
Professor Guha’s Course Archive
Style Notes
Please review the course Style Guide on the webcourse, with special attention to the following notes:
remove excess comments and instructions, leaving pre- and post-conditions and comments in the main function. Add comments to the supplemental functions you write as normal.
comment major sections of code addressing: “What does this block do?” and “Why did I implement this block in this way?”
place comments above the line(s) to which it applies
use inline comments (//) and leave one space between // and the comment’s first character
All variables should be declared at the top of your functions and should have meaningful names Indent the contents of functions four spaces or one tab
leave a space on both sides of any binary or conditional operators you use in your code (i.e., operators that take two operands).
keywords if, while, and for should have a single space after them
contents of if statements and loops should be indented four spaces or one tab
conditions should not have any space immediately after each ( or immediately before each ) .
Deliverables
One source file: marscolony.c for your solution to the given problem submitted over WebCourses.
Restrictions
Although you may use other compilers, your program must compile and run using Code::Blocks. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Also, make sure you include comments throughout your code describing the major steps in solving the problem.
Grading Details
Your programs will be graded upon the following criteria: