Starting Out with Python Plus MyLab Programming with Pearson eText -- Access Card Package (4th Edition)
4th Edition
ISBN: 9780134543666
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 5, Problem 11MC
A variable that is visible to every function in a
a. local variable
b. universal variable
c. program-wide variable
d. global variable
Expert Solution & Answer
Learn your wayIncludes step-by-step video
schedule03:35
Students have asked these similar questions
fprintf is a function that displays formatted output to the screen and a text file if used correctly?
True or False
Python
Create a text file named “Books.txt”.Open the text file and add the name of at least two books.In your Python3 code file, create a function that will loop through and display a menuwith options to Display, Add, Exit. It will end once the user selects the option for exit.Create another function that will accept the user’s choice with the outcome for eachoption.Display – read the file and output each lineAdd – prompt the user for a book name and append it to the file.
Exit – close the file and exit the loopRun the code to display your output.
IN PYTHON
Problem Statement
Given a text file of Zoom users wanting to attend a meeting, filter out a list of users with the domain name @my.fltech.com or @fltech.edu. Then print the list with names (last name, first name) of those with authenticated tech email. Print one name in each new line.
Note: the file name is not given by "input()". Instead, assume a file named "zoom_attendees.csv" is available that you need to open/use.
Sample Input: zoom_attendees.csv
Jackson,Thompson,jackson.thompson@fltech.edu Mines,mines,luke.wallace@lycos.com David,Wright,david.wright@fltech.edu Nathaniel,Butler,nathaniel.butler@aol.com
Sample Output
Thompson, Jackson Wright, David
Chapter 5 Solutions
Starting Out with Python Plus MyLab Programming with Pearson eText -- Access Card Package (4th Edition)
Ch. 5.1 - What is a function?Ch. 5.1 - Prob. 2CPCh. 5.1 - How do functions help you reuse code in a program?Ch. 5.1 - How can functions make the development of multiple...Ch. 5.1 - How can functions make it easier for programs to...Ch. 5.2 - A function definition has what two parts?Ch. 5.2 - What does the phrase calling a function mean?Ch. 5.2 - When a function is executing, what happens when...Ch. 5.2 - Prob. 9CPCh. 5.4 - What is a local variable? How is access to a local...
Ch. 5.4 - What is a variables scope?Ch. 5.4 - Prob. 12CPCh. 5.5 - What are the pieces of data that are passed into a...Ch. 5.5 - What are the variables that receive pieces of data...Ch. 5.5 - Prob. 15CPCh. 5.5 - When a parameter is changed, does this affect the...Ch. 5.5 - The following statements call a function named...Ch. 5.6 - What is the scope of a global variable?Ch. 5.6 - Give one good reason that you should not use...Ch. 5.6 - Prob. 20CPCh. 5.7 - How does a value-returning function differ from...Ch. 5.7 - Prob. 22CPCh. 5.7 - Prob. 23CPCh. 5.7 - What does the following statement do? x =...Ch. 5.7 - What does the following statement do? print...Ch. 5.7 - What does the following statement do? print...Ch. 5.7 - What does the following statement do? print...Ch. 5.7 - What does the following statement do? print...Ch. 5.7 - When the random module is imported, what does it...Ch. 5.7 - What happens if the same seed value is always used...Ch. 5.8 - Prob. 31CPCh. 5.8 - Look at the following function definition: def...Ch. 5.8 - What is a Boolean function?Ch. 5.9 - What import statement do you need to write in a...Ch. 5.9 - Write a statement that uses a math module function...Ch. 5.9 - Write a statement that uses a math module function...Ch. 5 - A group of statements that exist within a program...Ch. 5 - A design technique that helps to reduce the...Ch. 5 - The first line of a function definition is known...Ch. 5 - You___a function to execute it. a. define b. call...Ch. 5 - A design technique that programmers use to break...Ch. 5 - Prob. 6MCCh. 5 - A ______ is a variable that is created inside a...Ch. 5 - Prob. 8MCCh. 5 - Prob. 9MCCh. 5 - Prob. 10MCCh. 5 - A variable that is visible to every function in a...Ch. 5 - Prob. 12MCCh. 5 - This is a prewritten function that is built into a...Ch. 5 - This standard library function returns a random...Ch. 5 - This standard library function returns a random...Ch. 5 - This standard library function returns a random...Ch. 5 - This statement causes a function to end and sends...Ch. 5 - This is a design tool that describes the input,...Ch. 5 - This type of function returns either True or...Ch. 5 - This is a math module function. a. derivative b....Ch. 5 - The phrase "divide and conquer" means that all of...Ch. 5 - Functions make it easier for programmers to work...Ch. 5 - Function names should be as short as possible.Ch. 5 - Calling a function and defining a function mean...Ch. 5 - A flowchart shows the hierarchical relationships...Ch. 5 - A hierarchy chart does not show the steps that are...Ch. 5 - A statement in one function can access a local...Ch. 5 - In Python, you cannot write functions that accept...Ch. 5 - In Python, you can specify which parameter an...Ch. 5 - You cannot have both keyword arguments and...Ch. 5 - Some library functions are built into the Python...Ch. 5 - You do not need to have an import statement in a...Ch. 5 - Complex mathematical expressions can sometimes be...Ch. 5 - A function in Python can return more than one...Ch. 5 - IPO charts provide only brief descriptions of a...Ch. 5 - How do functions help you to reuse code in a...Ch. 5 - Name and describe the two parts of a function...Ch. 5 - When a function is executing, what happens when...Ch. 5 - What is a local variable? What statements are able...Ch. 5 - What is a local variable's scope?Ch. 5 - Prob. 6SACh. 5 - Suppose you want to select a random number from...Ch. 5 - What statement do you have to have in a...Ch. 5 - What three things are listed on an IPO chart?Ch. 5 - What is a Boolean function?Ch. 5 - Prob. 11SACh. 5 - Write a function named times_ten. The function...Ch. 5 - Examine the following function header, then write...Ch. 5 - Look at the following function header: der...Ch. 5 - What will the following program display? def main...Ch. 5 - Look at the following function definition def...Ch. 5 - Write a statement that generates a random number...Ch. 5 - The following statement calls a function named...Ch. 5 - A program contains the following function...Ch. 5 - Write a function named times_ten that accepts a...Ch. 5 - Write a function named get_first_name that asks...Ch. 5 - Kilometer Converter The Kilometer Converter...Ch. 5 - Sales Tax Program Refactoring Programming Exercise...Ch. 5 - How Much Insurance? Many financial experts advise...Ch. 5 - Automobile Costs Write a program that asks the...Ch. 5 - Property Tax A county collects property taxes on...Ch. 5 - Calories from Fat and Carbohydrates A nutritionist...Ch. 5 - Stadium Seating There are three seating categories...Ch. 5 - Paint Job Estimator A painting company has...Ch. 5 - Monthly Sales Tax A retail company must file a...Ch. 5 - Feet to Inches The Feet to Inches Problem One foot...Ch. 5 - Math Quiz Write a program that gives simple math...Ch. 5 - Maximum of Two Values Write a function named max...Ch. 5 - Falling Distance When an object is falling because...Ch. 5 - Kinetic Energy In physics, an object that is in...Ch. 5 - Test Average and Grade Write a program that asks...Ch. 5 - Odd/Even Counter In this chapter, you saw an...Ch. 5 - Prime Numbers A prime number is a number that is...Ch. 5 - Prime Number List This exercise assumes that you...Ch. 5 - Future Value Suppose you have a certain amount of...Ch. 5 - Random Number Guessing Game Write a program that...Ch. 5 - Rock, Paper, Scissors Game Write a program that...Ch. 5 - Turtle Graphics: Triangle Function Write a...Ch. 5 - Turtle Graphics: Modular Snowman Write a program...Ch. 5 - Prob. 24PECh. 5 - Turtle Graphics: Checkerboard Write a turtle...Ch. 5 - Turtle Graphics: City Skyline Write a turtle...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What Ada construct provides support for abstract data types?
Concepts of Programming Languages (11th Edition)
Name the steps in the programming process.
Digital Fundamentals (11th Edition)
1. Read the problem statement. 2. Formulate the algorithm using pseudocode and top-down, stepwise refinement. 3...
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
When displaying a Java applet, the browser invokes the _____ to interpret the bytecode into the appropriate mac...
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Pay Period Gross Pay A particular employee earns 39,000 annually. Write a program that determines and displays ...
Starting Out with C++: Early Objects (9th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName, and whose output is: lastName, firstName middleInitial. Ex: If the input is: Pat Silly Doe the output is: Doe, Pat S. If the input has the form firstName lastName, the output is lastName, firstName. Ex: If the input is: Julia Clark the output is: Clark, Julia Here is the code that I have currently: string userName;int space1 = userName.find(' ');int space2 = userName.find(' ', space1 + 1);string firstName = userName.substr(0, space1);string lastName = userName.substr(space2 + 1);char midInitial = userName.substr(space1 + 1); getline(cin, userName); if (userName.find(' ', space1 + 1)) != string::npos) {cout << lastName << ", " << firstName << " " << userName.substr(space1 + 1) << "." << endl; Please help me with this program using c++.arrow_forwardI need help in creating a C(NOT C++ OR C#) function that will help to split a string that is present in each line of the text file. The words can vary from 7-10 letters (min-max) followed by some brief description. Not allowed to use beak,continue,exit. Example "Lemonade Drink- Made of Lemon" I want the function to seperate "Lemonade" and "Drink-Made of Lemon". "Bolognese Food-Italian meat based Sauce" I want the function to seperate "Bolognese" and " Food-Italian meat based Sauce".arrow_forward*The following needs to be in python For this application, you will need to create a Python application that reads the sales for 12 months from a file and calculates the total yearly sales as well as the average monthly sales. In addition, this program should let the user edit the sales for any month. Jan 14317 Feb 3903 Mar 1073 Apr 3463 May 2429 Jun 4324 Jul 9762 Aug 15578 Sep 2437 Oct 6735 Nov 88 Dec 2497 Step 1 Define a display_title() function and have it use the print() to show the text: [FirstName] [LastName]'s Monthly Sales Replace the placeholders with your own first and last name add a space using the print() Define a display_menu() function and have it Use the print() function several times to show the following text with a space after: COMMAND MENUmonthly - View monthly salesyearly - View yearly summaryedit - Edit sales for a monthexit - Exit program Step 2 Define a main() function Call the display_title() function and the…arrow_forward
- he following expressions (already in the coding box) with open('test1.txt', 'w') as test1_file: test1_file.write("Do you love Python programming?\n") test1_file.write("No, I don't.") create a file named test1.txt with the following content: Do you love Python programming? No, I don't. . Please write the code that reads the content from file test1.txt, and writes the content to file named test2.txt with the sentence "No, I don't" changed to "Yes, I do.". For example: Test Result with open('test2.txt', 'r') as test2_file: print(test2_file.read()) Do you love Python programming? Yes, I do.arrow_forwardThis is a program in C language. Help me debug this program. it has 3 errors. Please upload a screenshot also that it is working thank you./* This porgram uses the gotoxy() function and textcolor() for better screen display */ #include <iostream>#include <conio.h>#include <stdlib.h>using namespace std;main(){ int NoItem,ItemNo,Qty,ctr,Row=5; float UPrice,TAmt,ATendered,Change,APaid=0; char ItemDesc[15],TempChar; system("Color 5");; system("Color 2"); gotoxy(25,1);cout<< "[***] RICHLY SUPERMARKET [***]"; gotoxy(31,2);cout<< "Ayala Avenue, Makati"; gotoxy(6,4);cout<< "Item No. Description Qty. Unit Price Total Amount"; gotoxy(5,22);cout<< "No. of Item(s) Bought => [ ]"; gotoxy(37,22);cout<< "Total Amount to be Paid => "; gotoxy(37,23);cout<< "Amount Customer Tendered => "; gotoxy(37,24);cout<< "Amount of Change => "; gotoxy(31,22);cin>> NoItem;…arrow_forwardThe pressure of a gas changes as the volume and temperature of the gas vary. Write a program that uses theVan der Waals equation of state for gas, to create a file that displays in tabular form the relationship between the pressure and the volume of n molesof carbon dioxide at a constant absolute temperature (T). P is the pressure in atmospheres, and V is thevolume in liters. The Van der Waals constants for carbon dioxide are a = 3.592 L2 · atm/mol2 and b = 0.0427L/mol. Use 0.08206 L · atm/mol · K for the gas constant R. Inputs to the program include n, the Kelvintemperature, the initial and final volumes in milliliters, and the volume increment between lines of the table.Your program will output a table that varies the volume of the gas from the initial to the final volume insteps prescribed by the volume increment. Here is a sample run:arrow_forward
- select statement that will open file to append this is python hw file = open('ABC.txt', 'w') file = open('ABC.txt', 'a') file = open('ABC.txt', 'r') file = open('ABC.txt', 'rw')arrow_forwardIn previous chapters, you created applications for the Greenville Idol competition. Now, modify your version of the GreenvilleRevenue program created in Chapter 5 so that after the user enters the number of contestants in this year’s competition, the user is prompted for the appropriate number of contestant names and a code for each contestant that indicates the type of talent: S for singing D for dancing M for playing a musical instrument O for other. Make sure that all entered codes are valid, and if not, re-prompt the user to enter a correct code. For example, if Y is input, output Y is not a valid code, and re-prompt the user until a valid code is entered. After contestant data entry is complete, display a count of each type of talent. For example, if there were ten singers, four dancers, seven people who play musical instruments, and one in the other category, the output should be: The types of talent are: Singing 10 Dancing 4 Musical instrument 7 Other 1 Then, continuously…arrow_forwardIn previous chapters, you created applications for the Greenville Idol competition. Now, modify your version of the GreenvilleRevenue program created in Chapter 5 so that after the user enters the number of contestants in this year’s competition, the user is prompted for the appropriate number of contestant names and a code for each contestant that indicates the type of talent: S for singing D for dancing M for playing a musical instrument O for other. Make sure that all entered codes are valid, and if not, re-prompt the user to enter a correct code. For example, if Y is input, output Y is not a valid code, and re-prompt the user until a valid code is entered. After contestant data entry is complete, display a count of each type of talent. For example, if there were ten singers, four dancers, seven people who play musical instruments, and one in the other category, the output should be: The types of talent are: Singing 10 Dancing 4 Musical instrument 7 Other 1 Then, continuously…arrow_forward
- This is my min.c int min(int num1, int num2, int num3) { if (num1 < num2) { if (num1 < num3) { return num1; } } else if (num3 < num2) { if (num3 < num1) { return num3; } } else { return num2; } } This is my min.s .file"min.c" .text .globlmin .defmin;.scl2;.type32;.endef .seh_procmin min: pushq%rbp .seh_pushreg%rbp movq%rsp, %rbp .seh_setframe%rbp, 0 .seh_endprologue movl%ecx, 16(%rbp) movl%edx, 24(%rbp) movl%r8d, 32(%rbp) movl16(%rbp), %eax cmpl24(%rbp), %eax jge.L2 movl16(%rbp), %eax cmpl32(%rbp), %eax jge.L3 movl16(%rbp), %eax jmp.L1 .L2: movl32(%rbp), %eax cmpl24(%rbp), %eax jge.L5 movl32(%rbp), %eax cmpl16(%rbp), %eax jge.L3 movl32(%rbp), %eax jmp.L1 .L5: movl24(%rbp), %eax jmp.L1 .L3: .L1: popq%rbp ret .seh_endproc .ident"GCC: (GNU) 11.2.0"arrow_forwardThe code must be in C++. Ask the user to enter the name of a text file to read. The text file contains a huge amount of GPS data. Open the file and prompt the user to enter a number which would then correspond to 2 'lat' and 2 'lon' values. Thus, the user's input extracts 2 points of latitude and longitude from the file. So, there must be 4 variables saved as double type: latA, latB, which are the 2 lat values, and lonA, and lonB. Then, use the Haversine formula to find the shortest distsnce between these 2 points of latitude and longitude. A picture of part of the text file is shown.arrow_forwardCode needed for the following: Use the final numerical grade to look up the corresponding letter grade as follows: 90 - 100 = A 80 - 89 = B 70 - 79 = C 60 - 69 = D < 60 = F Use the final letter grade to look up a "witty" comment of your choice, using a SWITCH statement. A statement must be output for each letter grade above. For example: A = "Most excellent work” B = "IMHO You Passed" etc. Request an output file name from the user. Do not “hard-code” the file name in the program. Do not “hard-code” the file name in the program. Check to ensure the output file opens. If it does not open, display an appropriate message to the user and exit the program. For each student, output the following to the console (screen) and the output file in a neat, readable format. Output each input line on one output line. Use manipulators to output values in readable columns: Student Name, Total Points (numerical grade): NN. Letter Grade: X. Depending on letter grade, The witty comment.…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License