Question: Can you please help me with the following assignment and code it in C + + exactly as it is shown? CS 1 3 5

Can you please help me with the following assignment and code it in C++exactly as it is shown? CS 135-Assignment 3 Finally the user should be prompted to what the current minecraft day is. Remember, days
cannot be negative!
The program should be able to catch bad inputs and display an appropriate error message and
clase the program.
Determining the month:
The location and month affects the spawn rate of each crop separately. Because the program
only prompts the user for the total in-game days, we will need to calcul
Minecraft Steve needs your help!
Purpose:
The purpose of this assignment is to become comfortable integrating conditional
statements and decision making into C++programs. This allows programmers to
add depth and choice depending on conditions that are satisfied.
In this assignment, students will be able to implement C++code that implements
the following
Interactive user input
Input error checking
Use of conditional statements to execute decision making
Use of switch statements to handle multiple cases
Premise:
Minecraft Steve needs your help! Steve is trying to program a device that can tell whether or not
a crop can be found given a biome location on a particular month, and display the rate of the
crop spawn. As someone playing on his server, he has asked you to help design a prototype with
the following conditions:
Input Handling:
The prototype will need to prompt the user for a valid biome and output an error message if a
valid biome is not provided.
The valid biomes include: Grasslands, Tundra, and Forest.
The user will enter G,T,or F respectively. The program IS NOT case sensitive,meaning you will
need to handle lowercase letter inputs: g, t or f.
Hint: We can either make our conditional statements to include 6cases, or we can take
advantage of the tolower()or toupper()functions to change an uppercase letter to a lowercase
letter or vice versa.
tolower(char)-returns the lowercase character
toupper(char)-returns the uppercase character
Afterwards, the user should be prompted to input the crop they are interested in.Acceptable
inputs would be (C/c)and (P/p),for carrots and pumpkins. Finally the user should be prompted to what the current minecraft day is.Remember, days
cannot be negative!
The program should be able to catch bad inputs and display an appropriate error message and
clase the program.
Determining the month:
The location and month affects the spawn rate of each crop separately. Because the program
only prompts the user for the total in-game days, we will need to calculate which month we are
currently on.
Here are some assumptions we can make:
A minecraft year follows the traditional 12-month cycle
A minecraft year contains only 360days making each month exactly 30days.
Hint: With these assumptions, we can simply calculate the current month by taking the modulus
of the days with the number of days in a year. This will give us the leftover days in the current
year. Be careful as we have an extra case to consider as the last day of the year will be treated
as day 0.We can create a special case to accommodate this.
Example formula:
Day =(Numberofdays % daysinayear)
Month =round(DayDaysinamonth)
From there, we can determine our current month by dividing the remaining days with the days in
a month and rounding up.
Determining the rate:
Below is a table of the rates of both carrots and pumpkins. Note: *Carrots can only be found in the tundra biome from the months July -September.
Example Output:
Good Input:
$/a.out
Please enter the current biome
t
Please enter the crop you wish to find
c
Please enter the current day in game
599
Carrots can currently be found at 0.9x rate.
$/a.out
Please enter the current biome
9
Please enter the crop you wish to find
P
Please enter the current day in game
792
Pumpkins currently canno Example Output:
Good Input:
$/a.out
Please enter the current biome
t
Please enter the crop you wish to find
c
Please enter the current day in game
599
Carrots can currently be found at 0.9x rate.
$/a.out
Please enter the current biome
9
Please enter the crop you wish to find
P
Please enter the current day in game
792
Pumpkins currently cannat be found.
Bad Input:
$/a.out
Please enter the current biome
P
Error: Biome cannot be found
$/a.out
Please enter the current biome
t
Please enter the crop you wish to find
83
Error: Crop does not exist
$/a.out
Please enter the current biome
9
Please enter the crop you wish to find
P
Please enter the current day in game
-10
Error: Day cannot be negative be found.
Bad Input:
$/a.out
Please enter the current biome
P
Error: Biome cannot be found
$/a.out
Please enter the current biome
t
Please enter the crop you wish to find
83
Error: Crop does not exist
$/a.out
Please enter the current biome
9
Please enter the crop you wish to find
P
Please enter the current day in game
-10
Error: Day cannot be negative
Can you please help me with the following

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!