This week, you have started to investigate branching in code. For this activity, you will practice using branching in code with an IF statement by working in the Coral simulator. The code you will create should address the following scenario:
There is an amusement park where children of a certain age get a discount. At the ticket kiosk, the computer asks the age of the participant. If their age is younger than 15, the entrance price is $20. If their age is 15 or older, the price is $40.
To address the scenario, you will need to code a branching decision that does the following:
· Asks the user for their age
· Creates a message that will indicate the price of the ticket. The message should say, “The entrance price is _____.”
· Prints the correct price based on the user’s input of their age
Begin by navigating to the Coral Simulator (https://corallanguage.org/simulator/) page of the Coral website. As you work, you will be writing code directly on this page and then testing it by running the program or choosing to step through each line. You can change the execution speed if you want to move more quickly through the code or slow things down to pay closer attention to any particular aspect. It should also be noted that you can toggle to the flowchart of what you have created. Use this to check your work and ensure it is laid out the way you intend.
This simulator is not persistent, meaning it will not save your work if you leave the page. Be sure to copy your code into a TXT file, using one of the applications suggested in Module One of this course, so you can save your work and submit it.
Specifically, you must address the following rubric criteria:
· Determine the variables and relevant data types of each variable. Consider the necessary variables required to implement the logic of your game as well as the relevant data type (e.g., integer or float) of each variable.
· Set a branch that uses conditionals to define the logic of the game. This must meet the requirements of the program. This includes using the following:
Statements must also use the appropriate relational operators, which are as follows:
· == (equals)
· != (not equal)
· < (less than) · > (greater than)
· <= (less than or equal) · >= (greater than or equal)
· Apply necessary arithmetic operations. Note that mathematical operators include +, -, *, /, and % (modulo). This must meet the requirements of the program.
· Write code using best practices including appropriate syntax and commenting. This includes the following:
· Using descriptive names for your variables
· Using the correct formatting structure with appropriate indentations
· Using appropriate comments relating to your code
Guidelines for Submission
Submit a TXT file that includes your completed Coral code. This should be copied from the Coral simulator into one of the applications that works with text-based files, which you already set up in Module One.
Why Choose Us
- 100% non-plagiarized Papers
- 24/7 /365 Service Available
- Affordable Prices
- Any Paper, Urgency, and Subject
- Will complete your papers in 6 hours
- On-time Delivery
- Money-back and Privacy guarantees
- Unlimited Amendments upon request
- Satisfaction guarantee
How it Works
- Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
- Fill in your paper’s requirements in the "PAPER DETAILS" section.
- Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
- Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
- From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.