exam questions

Exam 98-381 All Questions

View all questions & answers for the 98-381 exam

Exam 98-381 topic 1 question 23 discussion

Actual exam question from Microsoft's 98-381
Question #: 23
Topic #: 1
[All 98-381 Questions]

HOTSPOT -
You are an intern for ABC electric cars company. You must create a function that calculates the average velocity of their vehicles on a 1320 foot (1/4 mile) track.
The output must be as precise as possible.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References: https://www.w3resource.com/python/python-data-type.php

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
pravesh512
Highly Voted 5 years, 1 month ago
The output must be as precise as possible hence distance and time will be float
upvoted 14 times
LiamW28
5 years ago
If it's as precise as possible then you shouldn't float the distance, as it will be calculated at exactly 1320 feet
upvoted 4 times
...
Vaibhavdhingra24
5 years ago
So you're saying, both should be in float?
upvoted 3 times
FuzzyDunlop
4 years, 11 months ago
That's what I think it should be, if the distance is a float, the user can put in partial feet to be more precise, otherwise they would have to round up/down.
upvoted 3 times
...
hedi12
4 years, 3 months ago
yes it is
upvoted 1 times
...
...
...
palsadat
Most Recent 1 year, 8 months ago
So, what should we select in Real exam. it sounds like both of the input should be float but here selected integer.
upvoted 1 times
...
Kgotatso5050
3 years, 6 months ago
At what point would an integer not be used? if the output should be as precise as possible? i would assume integers are used as rounded off numbers are a lot more precise with regards to the use of decimals?? looking for help.. i used both type floats
upvoted 1 times
...
Mist3
4 years, 1 month ago
I would use both floats as the question doesn't state whether we measure our avg speed over whole lap.
upvoted 1 times
...
Dragon12
4 years, 2 months ago
From my understanding the length of the track will never change from the listed 1320 ft. so assigning the input as an "int' is more than sufficient. Assigning the input as a float would be redundant given the unchanging size of the track. With that in mind we then simply need to assign time as a "float" input. Different cars will be able to finish at different speeds.
upvoted 2 times
ruturaj_dm
3 years, 11 months ago
Even if the distance of track remains same, we're trying here to take it from user. If he provides input as 1320.00, the program would fail. So from my experience it must be floats in both blanks.
upvoted 2 times
...
...
codibel
4 years, 3 months ago
it seems that the input for the distance should also be a float as a very precise input would get an error.
upvoted 1 times
...
gargaditya
4 years, 8 months ago
Both should be of type 'float' to ensure maximum precision;first answer is incorrect.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...