联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2019-08-18 11:15

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

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


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp