CSP2151 - Speed - Strength - Combat Effectiveness - Float Calculate Speed - IT Assignment Help

Download Solution Order New Solution
Assignment Task

 

Design and Implement the following:
1) Write a program that reads in 2 numbers from the console, offers a choice of mathematical operation and then displays the result of the requested operation. The program should ask if the user wishes to quit and repeat until it gets a set value.
2) Write a function int_max_3 that takes three int arguments and returns the largest of them as the value of the function.
3) Write a function that rolls a number of six-sided dice and returns the sum of the rolls. Then write a program that uses that function to roll a thousand dice and output the results.

 

Assessable tasks:  

Your next assessable task is to continue creation of the robotics competition simulation.

Design and implement (in C) the following:  

(1) Create three functions (one for each phase):  

float calculate_speed(float finish_line_distance, float finish_line_time) 

This function takes two float parameters, finish_line_distance and finish_line_time, as  arguments, and performs the speed test (or, calculate the speed) as done in the first  workshop and returns the robot’s speed.  

 int calculate_strength() 

This function prompts the user to input a whole number between 0 and 100 (representing  the number of objects the robot could successfully lift) and return that number.  

 int calculate_combat(float speed, int strength) 

It simulates 100 rounds of combat against human  opponents. Referencing to above the Robot’s Winning  Criteria, this function uses random number generation  for the combat and return a whole.

 

(2) Develop a program that should include a main() function, which calls each of the above  three functions in sequence. At the end of the main function, the user should be asked if  he/she would like to repeat the simulation again. The program should not end under any  circumstances other than the user choosing not to repeat. 

(3) Bonus Marks:  

You may find that in some extreme cases, the calculate_combat( …) function may return a  negative percentage or a percentage value greater than 100%.  

  • Give/list two scenarios: one case is where a negative percentage is reached and the  one is where a percentage value is greater than 100%. 
  • Workout your way to remove such unrealistic results (to keep the function result  always between 0% and 100%).  

 

Additional work and effort to improve the program and make it more useful can be worth  bonus marks. Up to 2 marks can be added for the above improvement. 

 

 

This CSP2151 IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.