exam questions

Exam 98-381 All Questions

View all questions & answers for the 98-381 exam

Exam 98-381 topic 1 question 20 discussion

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

DRAG DROP -
You are writing a Python program that evaluates an arithmetic formula.
The formula is described as b equals a multiplied by negative one, then raised to the second power, where a is the value that will be input and b is the result.
You create the following code segment. Line numbers are included for reference only.

You need to ensure that the result is correct.
How should you complete the code on line 02? To answer, drag the appropriate code segment to the correct location. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

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
gargaditya
Highly Voted 4 years, 7 months ago
Just a small correction in question,starting bracket ( missing for the input statement a=eval(input("Enter a number for the equation: "))
upvoted 7 times
...
BeeM
Most Recent 4 years, 1 month ago
can somebody tell me why it is not -(a)**2. The difference is that one result is negative and the other positive. The question doesnt state what form the result should be in
upvoted 2 times
ben09007
3 years, 6 months ago
It says a must be multiplied by negative one first then raised to the second power. The orders of operations are parenthesis then exponents then multiplication. In your equation, a is being raised to the second power first because the parenthesis in your formula doesn't do anything, when the question asks that you first multiply by negative one. So (-a)**2 is the correct answer.
upvoted 6 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 ...