CSP2151: Workshop


CSP2151: Workshop 1
Design and Implementthe following:
Write a program to print "Hello World!" on the screen.
Write a Program that declares the variable speed_kmph, and speed_mps. Ask the user to input a
value in kilometers per hour (km/h), convert the value to meters per second (m/s) and output the
result to the screen. The formula for converting from km/h to m/s is as follows:
Where M is in m/s and K is in km/h.
Assessable:

Your first assessable task is to begin creating a simulation of robotics competition.
The competition will consist of three phases.
1. Speed. The robots will race to reach the finish line.
2. Strength. The robots will attempt to lift several heavy objects.
3. Combat effectiveness. The robots will battle against 100 humans and then
receive a score based on the number of victories.
The first requirement of the simulation is to be able to calculate the speed of the
competition in phase one.
Design and implement the following program to calculate the speed for a robot to finish
the race in phase one.
(1) Prompt the user to enter 2 variables: finish_time (in sec) and distance (in meters)
(2) Calculate the resulting speed, s, using the formula:
where
s = average speed (m/s)
d = distance (m)
t = time (s)
In physics, the average speed of a moving body (e.g., a robot, a vehicle etc.) is equal to the
distance it traves divided by the time it takes to complete the movement.
Workshop Submission:
You are required to submit, through Blackboard (BB), a design document (there are marks

代做CSP2151留学生作业、代写c/c++,Java语言作业、代做Python编程作业
allocated just to design), your source code (e.g., *.c) and an executable code (e.g., *.exe).
You are encouraged to complete your Design by using a Flowchart (although it is also
acceptable if you use pseudocode).
You are also encouraged to submit one single compressed file (e.g., *.zip), which contains
all your file/s. Please rename the zip file as
CSP2151_Workshop1_<Your Student ID>_< Your full name>.zip.
and submit the .zip file only.
Note: if you experienced any difficulties in submitting your workshop through BB, you may then send your
Worhshop submission to your tutor (j.xiao@ecu.edu.au) by email attachment, with a short explanation of
what difficulties you experienced (e.g., BB was done, etc).
Workshop Marking Guide
(See Rubric in the last page)
Marking criteria Marks allocated
Design 6
Calculations 3
Code legibility (formatting, comments, etc.) 4
Compilation 4
Output 3
Total: /20
(3) Display on screen the following message:
“The robot has an average speed of <s> meters per second.”
where <s> is replaced by value of the speed calculated, e.g.,
The robot has an average speed of 16.0 meters per second.
If any of the finish_time or distance is entered a value of 0 or less, an Error
message should be displayed on the screen, instead of the above output. The
error message may look like
“Error: invalid data entered!”
The next two phases of the simulation will be completed in Workshop 2.
Rubric
Not proficient Low Proficiency Developing

 

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codehelp

上一篇:Js中闭包的概念、原理、作用及应用


下一篇:C Primier Plus(第六版)第5章 编程练习 VS2019测试