5/5 - (2 votes)

Pass Microsoft 98-381 Exam Quickly With BraindumpStudy

Prepare 98-381 Question Answers – 98-381 Exam Dumps

Domain Input as well as Output (I/O) Operations

The third exam section throws a considerable amount of light on the concepts such as code writing related to input and output. Candidates should be skilled in writing & testing code segments responsible for running console I/O operations along with ones for files. They have to know how to use command-line arguments, read input from the console, and print formatted text, among the rest.

 

NO.10 HOTSPOT
You work for a company that distributes media for all ages.
You are writing a function that assigns a rating based on a user’s age. The function must meet the following requirements:
Anyone 18 years old or older receives a rating of “A”
Anyone 13 or older, but younger than 18, receives a rating of “T”
Anyone 12 years old or younger receives a rating of “C”
If the age is unknown, the rating is set to “C”
You need to complete the code to meet the requirements.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:

NO.11 HOTSPOT
You are designing a decision structure to convert a student’s numeric grade to a letter grade. The program must assign a letter grade as specified in the following table:

For example, if the user enters a 90, the output should be, “Your letter grade is A”.
Likewise, if a user enters an 89, the output should be “Your letter grade is B”.
How should you complete the code? To answer, select the appropriate code segments in the answer area.

NO.12 You are creating a Python program that shows a congratulation message to employees on their service
anniversary.
You need to calculate the number of years of service and print a congratulatory message.
You have written the following code. Line numbers are included for reference only.

You need to complete the program.
Which code should you use at line 03?

 
 
 
 

NO.13 This question requires that you evaluate the underlined text to determine if it is correct.
You write the following code:

The out.txt file does not exist. You run the code. The code will execute without error.
Review the underlined text. If it makes the statement correct, select “No change is needed”. If the statement is
incorrect, select the answer choice that makes the statement correct.

 
 
 
 

NO.14 You are creating a function that reads a data file and prints each line of the file.
You write the following code. Line numbers are included for reference only.

The code attempts to read the file even if the file does not exist.
You need to correct the code.
Which three lines have indentation problems? Each correct answer presents part of the solution. (Choose
three.)

 
 
 
 
 
 
 
 

NO.15 HOTSPOT
You are developing a Python application for an online game.
You need to create a function that meets the following criteria:
The function is named update_score
The function receives the current score and a value
The function adds the value to the current score
The function returns the new score
How should you complete the code? To answer, select the appropriate code segments in the answer area.

NO.16 HOTSPOT
The ABC company is building a basketball court for its employees to improve company morale.
You are creating a Python program that employees can use to keep track of their average score.
The program must allow users to enter their name and current scores. The program will output the user name and the user’s average score. The output must meet the following requirements:
The user name must be left-aligned.

If the user name has fewer than 20 characters, additional space must be added to the right.

The average score must have three places to the left of the decimal point and one place to the right of

the decimal (XXX.X).
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

NO.17 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 ais the value that will be input and bis 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:

NO.18 DRAG DROP
You are building a Python program that displays all of the prime numbers from 2 to 100.
How should you complete the code? To answer, drag the appropriate code segments 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.

NO.19 The ABC company is creating a program that allows customers to log the number of miles biked. The program will send messages based on how many miles the customer logs.
You create the following Python code. Line numbers are included for reference only.

You need to define the two required functions.
Which code segments should you use for line 01 and line 04? Each correct answer presents part of the solution? (Choose two.)

 
 
 
 
 
 

NO.20 DRAG DROP
You are building a Python program that displays all of the prime numbers from 2 to 100.
How should you complete the code? To answer, drag the appropriate code segments 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:

NO.21 HOTSPOT
You create the following program to locate a conference room and display the room name. Line numbers are included for reference only.

Colleagues report that the program sometimes produces incorrect results.
You need to troubleshoot the program. Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
Hot Area:

NO.22 This question requires that you evaluate the underlined text to determine if it is correct.
You write the following code:

The out.txt file does not exist. You run the code. The code will execute without error.
Review the underlined text. If it makes the statement correct, select “No change is needed”.
If the statement is incorrect, select the answer choice that makes the statement correct.

 
 
 
 

NO.23 HOTSPOT
You are developing a Python application for an online game.
You need to create a function that meets the following criteria:
The function is named update_score

The function receives the current score and a value

The function adds the value to the current score

The function returns the new score

How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:

NO.24 HOTSPOT
You develop a Python application for your company.
You have the following code. Line numbers are included for reference only.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
Hot Area:

NO.25 You are creating a Python program that shows a congratulation message to employees on their service anniversary.
You need to calculate the number of years of service and print a congratulatory message.
You have written the following code. Line numbers are included for reference only.

You need to complete the program.
Which code should you use at line 03?

 
 
 
 

NO.26 You are writing a Python program to automate inventory. Your first task is to read a file of inventory transactions. The file contains sales from the previous day, including the item id, price, and quantity.
The following shows a sample of data from the file:

The code must meet the following requirements:
Each line of the file must be read and printed
If a blank line is encountered, it must be ignored
When all lines have been read, the file must be closed
You create the following code. Line numbers are included for reference only.

Which code should you write for line 05 and line 06?

 
 
 
 

NO.27 DRAG DROP
You are creating a Python script to evaluate input and check for upper and lower case.
Which four code segments should you use to develop the solution? To answer, move the appropriate code segment from the list of code segments to the answer area and arrange them in the correct order.

NO.28 You are creating a function that reads a data file and prints each line of the file.
You write the following code. Line numbers are included for reference only.

The code attempts to read the file even if the file does not exist.
You need to correct the code.
Which three lines have indentation problems? Each correct answer presents part of the solution. (Choose three.)

 
 
 
 
 
 
 
 

NO.29 HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.

NO.30 HOTSPOT
You work for a company that distributes media for all ages.
You are writing a function that assigns a rating based on a user’s age. The function must meet the following requirements:
* Anyone 18 years old or older receives a rating of “A”
* Anyone 13 or older, but younger than 18, receives a rating of “T”
* Anyone 12 years old or younger receives a rating of “C”
* If the age is unknown, the rating is set to “C”
You need to complete the code to meet the requirements.

NO.31 You are writing an application that uses the sqrtfunction. The program must reference the function using the
name squareRoot.
You need to import the function.
Which code segment should you use?

 
 
 
 

NO.32 HOTSPOT
You develop a Python application for your company.
You have the following code. Line numbers are included for reference only.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.


Real Microsoft 98-381 Exam Questions [Updated 2022]: https://www.braindumpstudy.com/98-381_braindumps.html

         

Related Links: www.stes.tyc.edu.tw www.stes.tyc.edu.tw myportal.utt.edu.tt myportal.utt.edu.tt myportal.utt.edu.tt myportal.utt.edu.tt