Concept explainers
In Exercises 33 through 40, determine the output displayed in the list box by the lines of code.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Pearson eText for Introduction to Programming Using Visual Basic -- Instant Access (Pearson+)
Additional Engineering Textbook Solutions
Modern Database Management (12th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
C++ How to Program (10th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
- PYTHON PROGRAMMING ASSIGNMENT PYTHON PROGRAMMING LANGUAGE ASSIGNMENT Create a new text document called names.txt (this is done by hand - not using programming) with the following names: Adam, Bryan, Charlie. Each name should be followed by a hard return (do not store them in a list). Main Function. Write a program where the user enters a name. Using the read function, check to see if the name is in the text document. If it is, respond back to the user the name is found within the list. Read Function. The read function should return the contents of the text document as a list. Write Function. The write function should take the list and override the file with the new names list in reverse alphabetical order with a hard return after each name.arrow_forwardIntroduction Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: Each team has a name, which is one of the uppercase letters A-Z. No two teams have the same name, so there are a maximum number of 26 teams. Each team has the same number of members. No two runners cross the finish line at the same time – i.e. there are no ties. At the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Team A’s runners finished in 3rd, 5th and 6th place. Team Z’s runners finished in 1st, 2nd and 4th place. Scoring the race Each runner is assigned a score equal to their finishing place. In the example above team Z’s runners achieved scores of 1, 2 and 4. Team A’s runners scores were 3, 5, and 6 respectively. The team’s score is the sum of the members score divided by the number of people on…arrow_forwardExplain every step pleasearrow_forward
- # Segmentation Questionarrow_forward10. The algorithm shown in Figure 1-13 should calculate and print the gross pay for five workers; however, some of the instructions are missing from the algorithm. Complete the algorithm. If an employee works more than 40 hours, he or she should receive time and one-half for the hours worked over 40. read the employee's name, hours worked, and pay rate calculate gross pay = hours worked times pay rate otherwise, do this: calculate regular pay = pay rate times 40 calculate overtime hours = hours worked minus 40 calculate overtime pay = calculate gross pay = end if print the employee's name and gross pay end repeatarrow_forwarduse numbers in second picture rather than first pleasearrow_forward
- Multiple Choice Identify the choice that best completes the statement or answers the question. 1. A list of numbers has n elements, indexed from 1 to n. The following algorithm is intended to display the number of elements in the list that have a value greater than 100. The algorithm uses the variables count and position. Steps 3 and 4 are missing. Step 1: Set count to 0 and position to 1. Step 2: If the value of the element at index position is greater than 100, increase the value of count by 1. Step 3: (missing step) Step 4: (missing step) na viliog dbod cour pot Step 5: Display the value of count. Which of the following could be used to replace steps 3 and 4 so that the algorithm works as intended? Step 3: Repeat step 2 until the value of count is greater than 100. Step 3: Repeat step 2 until the value of position is greater than n. a. c. Step 4: Increase the value of position by Step 4: Increase the value of count by 1. 1. b. Step 3: Increase the value of position by d. Step 3:…arrow_forward# TASKS # 1. Add a line of code to find and print the length of 'list_of_powers' # 2. Modify the upper limit of the loop to be 100000 and run the program again # 3. Find and print the maximum and minimum number in the list # 4. Add a while loop which will check to make sure the number entered by the user is a positive number A# 5. Add comments to the code below to explain what is happening i = 0 UPPER_LIMIT = 10000 list_of_powers = [] power = int(input("Enter a power \n")) Ewhile (i**power < UPPER_LIMIT): list_of_powers.append(i**power) i += 1 print(list_of-powers)arrow_forwardvisual basic2010arrow_forward
- Rent A Van wants a program that calculates the total cost of renting a van. Customers pay a base fee plus a charge per mile driven. Complete an IPO chart for this problem. Desk-check the algorithm using $50, $0.20, and 1000 as the base fee, charge per mile, and number of miles driven, respectively. Then desk-check it using your own set of dataarrow_forwardvisual basic problemarrow_forwardURGENT!arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage