Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 5, Problem 13PE
Program Plan Intro
Program plan
- In the “main()” function,
- Declare variables “filename” and “infile” and get input from the user.
- Declare variable “data” and “numofwords”.
- Execute “for” loop and perform append function.
- Calculate “totallength” and “wordaverage”.
- Print average word length, total number of words and total number of letters.
- Call the function “main()”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
QUESTION
One of the downsides of using expressions that produce results other than true or false is
it is expensive to type-check
it hurts readability since it may be confusion to know which route an execution will take.
it can cause side effects skewing the results of the rest of the code
it hurts writability since we have to write such long expressions.
Can you help me create a C Program with File Handling Manipulation? It should be a menu-driven with CRUDE transactions. (Create, Read, Update and Delete).
Sample program (library, ordering, inventory, POS, bank, ticketing, rental, reservation, etc.). But here's my program and I created something like a students record. where there is the students number (roll number), the students name, the students course and the students total grade percentage.
#include <stdio.h>#include <stlib.h>
struct student{ int roll_no; char name[30]; char course[30]; float pecentage; };
void create();void read();void update();void delete();
int main(){ int choice; printf("Choose one of the options given below"); printf("1. Add Students record"); printf("2. Read Students record"); printf("3. Update Students record"); printf("4. Delete Studentsrecord"); printf("ENTER YOUR CHOICE"); scanf("%d", &choice);
}
For those who are unfamiliar, what exactly is a "program slice"? We need to talk about segmenting programs both statically and dynamically.
Chapter 5 Solutions
Python Programming: An Introduction to Computer Science, 3rd Ed.
Ch. 5 - Prob. 1TFCh. 5 - Prob. 2TFCh. 5 - Prob. 3TFCh. 5 - Prob. 4TFCh. 5 - Prob. 5TFCh. 5 - Prob. 6TFCh. 5 - Prob. 7TFCh. 5 - Prob. 8TFCh. 5 - Prob. 9TFCh. 5 - Prob. 10TF
Ch. 5 - Prob. 1MCCh. 5 - Prob. 2MCCh. 5 - Prob. 3MCCh. 5 - Prob. 4MCCh. 5 - Prob. 5MCCh. 5 - Prob. 6MCCh. 5 - Prob. 7MCCh. 5 - Prob. 8MCCh. 5 - Prob. 9MCCh. 5 - Prob. 10MCCh. 5 - Prob. 1DCh. 5 - Prob. 2DCh. 5 - Prob. 3DCh. 5 - Prob. 4DCh. 5 - Prob. 5DCh. 5 - Prob. 1PECh. 5 - Prob. 2PECh. 5 - Prob. 3PECh. 5 - Prob. 4PECh. 5 - Prob. 5PECh. 5 - Prob. 6PECh. 5 - Prob. 7PECh. 5 - Prob. 8PECh. 5 - Prob. 9PECh. 5 - Prob. 10PECh. 5 - Prob. 11PECh. 5 - Prob. 12PECh. 5 - Prob. 13PECh. 5 - Prob. 14PECh. 5 - Prob. 15PECh. 5 - Prob. 16PE
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
- Suggest one further small extension or improvement of your own to the modified flashcard program. Outline what the extension does and briefly say what additional sub-problem(s) would need to be added to the initial decomposition. Note that you are only required to describe your further extension and do not need to implement it in code. The maximum word count is 150 words, including the added sub-problem(s).arrow_forwardTo be done using C programming:Two identical files are given with different names to them. But some characters in the content of the second file are corrupted. Find the line number and their position where those corrupted letter exists as well as Total number of corrupted (error) letters. Examples: Input: File1.txt contains It is fun to code with C File1.txt contains It is fun to code with C# Output: Line Number : 2 Error Position:2 Total Errors:1 Steps Open two file using File pointer in read only mode. Fetch data of file in two char variable one by one until end of file. If variable encounter new line then increment line number and reset position to zero. If variables are not equal then increment number of error and print error line as well as error index.arrow_forwardCan you help me with something like this in C++? You can use as many h files and cpp files and a main file as you want. What is my program supposed to do: I want to create a program that will be able to achieve all the goals of the capstone project while successfully achieving what it is supposed to do. I want to be able to create a program that can extract a player's name based on the sport I decide to choose (either football, basketball, or baseball) and have them be placed on the user's team where they can choose to keep them or remove them from said team. As the season progresses the user will go into the program and input the stats of their players and the program will calculate their fantasy performance based on what the user inputs. The user may also be able to put in, take out, or adjust any stats that are calculated at any time during the season. The user will also take the players and be able to choose from a number of options on what to do with them. I hope to either make it…arrow_forward
- Take a python code on program of your choice and apply all compilation phases/ steps on it. Write down the outputof each step in presentable form.arrow_forwardPlease help with the compilation techniques question in the picture below:arrow_forwardWrite a programme in C called pgmAssemble which can be used to assemble a large image from smaller ones. It should take 3n+3 arguments of which the first three are: an output file name width of the output image height of the output image and the remainder are the layout: triples of: 3i+1. row at which the subimage starts 3i+2. column at which the subimage starts 3i+3. The subimage to insert at that locationarrow_forward
- Describe how you would achieve a program in C++ that does the following: Output a header and page number on each page with the first page being number 1 and each page being one higher. Do this without using parameters and without reference to non-local variables. This is not a coding question. Provide either an explanation of your approach or the pseudocode.arrow_forwardDevelop the same code as exact as possible for the same problem with. the same data and. compare the compiled size then try to execute it on a lot of data (for map or set) and track the time. State the. time. and size taken for STL and python. Let me. know your conclusion.arrow_forwardFrom Operating System Concepts By Gagne, Galvin, Silberschatz. 10th edition Chapter 2 Project, implementation has to be in C: This assignment will involve designing two kernel modules: 1. Design a kernel module that creates a /proc file named /proc/jiffies that reports the current value of jiffies when the /proc/jiffies file is read, such as with the command cat /proc/jiffies. Be sure to remove /proc/jiffies when the module is removed. 2. Design a kernel module that creates a proc file named /proc/seconds that reports the number of elapsed seconds since the kernel module was loaded. This will involve using the value of jiffies as well as the HZ rate. When a user enters the command cat /proc/seconds your kernel module will report the number of seconds that have elapsed since the kernel module was first loaded. Be sure to remove /proc/seconds when the module is removed.arrow_forward
- Write a program (in C programming) cylinder.c that accomplishes the following: Read a list of radii and heights from a file(cylinder_input.data). For each pair of values, calculate the cylinder's volume and surface area. Display the results on the screen and save the results to a file. File: cylinder_input.data 1.5 10.2 2.21 20 3 30.243 55.23 2.2 12.1 45.989 The contents of the output file “cylinder_output.data” 1.500000 10.200000 72.099551 110.269902 2.210000 20.000000 306.877054 308.404496 3.000000 30.243000 855.100680 626.615787 55.230000 2.200000 21082.525775 19929.377237 12.100000 45.989000 21153.127133 4416.305811arrow_forwardA fence around a field is shaped as shown in the Figure attached. It consists of a rectangle of length L and width W and a right triangle that is symmetric about the central horizontal axis of the rectangle. Suppose the width W is known (in meters) and the enclosed area A is known (in square meters). Write a MATLAB script file in terms of the given variables W and A to determine the length L required so that the enclosed area is A. Also determine the total length of fence required. Test your script for the values W=6 m and A=80 m2.arrow_forwardRead problem carefully. Solve problem using 5-steps of Engineering Problem Solving Methodology (including algorithm) in MS-Word file save it as your id (123456). Draw flowchart diagram in MS-Visio (or any other software) and save it as an image file using your id (123456). • Write a C++ program and save it as C++ (.cpp) file using your id (123456). • Place above three files in a folder and save it as your id (123456) then compress it and upload on the given link for submission of homework 2 in the Moodle. Problem Statement: An election is a formal group decision-making process by which a population chooses a candidate by casting votes. Each candidate is assigned name and a specific symbol. A ballot paper is used to cast the vote. Each ballot paper contains symbols of the candidate. A person can vote a candidate by stamping on a specific symbol. The ballot paper should be considered as a spoilt ballot if a person does not stamp or stamp on more than one symbol. Finally ballot paper has…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education