Write a python program that writes data to a file. The data consists of a series...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a python program that writes data to a file. The data consists of a series of records, each with two fieids - a name, followed by a grade (assuming that the grade is non-negative, and no input validation is needed). Your program should: i. Prompt the user to enter the number of records that he/she needs to enter. ii. Write the data to the file, with each entered value on a separate line. Below is an example of what the expected output of your program should be (Do not use the same inputs): Enter the number of records that you need to enter: 3 Enter the name: Ahmad Enter the grade: 93 Enter the name: Abir Enter the grade: 95 Enter the name: Moatasem Enter the grade: 78 The created file will be: I"cores.bt-Notepad File Edit Format View Help Ahmad 93 Abir 95 Moatasem 78 100% Windows (CRLF) UTF-8 Write a python program that writes data to a file. The data consists of a series of records, each with two fieids - a name, followed by a grade (assuming that the grade is non-negative, and no input validation is needed). Your program should: i. Prompt the user to enter the number of records that he/she needs to enter. ii. Write the data to the file, with each entered value on a separate line. Below is an example of what the expected output of your program should be (Do not use the same inputs): Enter the number of records that you need to enter: 3 Enter the name: Ahmad Enter the grade: 93 Enter the name: Abir Enter the grade: 95 Enter the name: Moatasem Enter the grade: 78 The created file will be: I"cores.bt-Notepad File Edit Format View Help Ahmad 93 Abir 95 Moatasem 78 100% Windows (CRLF) UTF-8
Expert Answer:
Related Book For
Posted Date:
Students also viewed these chemical engineering questions
-
Python 3 Write a python program that generates 1,000 random integers between 0 and 9 and displays the count for each number (Hint: Use a list of ten integers, say counts, to store the counts for the...
-
Write a Python program that repeatedly reads lines from standard input until an EOFError is raised, and then outputs those lines in reverse order (a user can indicate end of input by typing ctrl-D).
-
Write a Python program that outputs all possible strings formed by using the characters 'c', 'a', 't', 'd', 'o', and g exactly once.
-
What are some advantages of sole proprietorship for PODS? What are some of the disadvantages?
-
The quarterly sales data (number of copies sold) for a college textbook over the past three years follow: a. Construct a time series plot. What type of pattern exists in the data? b. Use an Excel or...
-
Briefly describe the insurance company ratings assigned by A. M. Best, Moodys, Fitch, and Standard & Poors. Why is it important to know how a company is rated? What ratings would you look for when...
-
What could have been done better? Jill was hired as the manager of a 40-member multispecialty medical practice with 180 support staff. The practices five clinics were generally prosperous, but a few...
-
Vertical analysis (common-size) percentages for Vallejo Company's sales, cost of goods sold, and expenses are listed here. Did Vallejo's net income as a percent of sales increase, decrease, or remain...
-
A share of stock with a beta of .82 now sells for $58. Investors expect the stock to pay a year-end dividend of $2. The T-bill rate is 5%, and the market risk premium is 8%. a. Suppose investors...
-
You first need to download the spreadsheet with stock price and return data from the Assignments tab in Canvas and access the spreadsheet tab titled "Stock Price Data". This tab contains monthly...
-
At the end of last year, King Power Company achieved $6 million in revenues (EBITDA). Depreciation expense was $1.2 million, interest expense expense was $800,000, and the corporate tax rate was 35%....
-
Should workers compensation insurance continue to be no-fault? Why, or why not?
-
What is the effect on reported net income of applying the lower-of-cost-or-net realizable value method to ending inventory?
-
Which of the following is not an inventory costing method? a. Specific identification b. Weighted-average cost c. Just-in-time manufacturing d. FIFO
-
What are just-in-case inventory and inventory carrying costs?
-
Moyer Company has an inventory turnover of 4.51 . What is Moyer's days' sales in inventory?
-
Analyze Big Ben by Andre Derain with color vibration
-
With your classmates, form small teams of skunkworks. Your task is to identify an innovation that you think would benefit your school, college, or university, and to outline an action plan for...
-
1.Suppose the MovedEventHandler delegate is defined by the statement delegate void MovedEventHandler(). Which of the following correctly declares the Moved event? a.public MovedEventHandler...
-
Consider the following relation: CAR_SALE(Car#, Date_sold, Salesperson#, Commission%, Discount_amt) Assume that a car may be sold by multiple salespeople, and hence {Car#, Salesperson#} is the...
-
In February 2008, Ceramic Crucibles of America was notified by the state of Colorado that the state was investigating the company's Durango facility to determine if there were any violations of...
-
Analyzing marketing variances A manufacturing company makes three different sizes of bass boats. These boats are sold to distributors who outfit them for fishing by adding outboard motors and...
-
Direct material variances The Baba Jim Company makes a variety of furniture items. One product, a sofa, has the following material standards: Pine lumber Oak lumber Springs 20 board feet @ $ .80 per...
-
Direct labor variances Wha Joon Company makes steel shelves, steel furniture, and several other steel products primarily for use in offices and industrial organizations. Standard labor costs for the...
Study smarter with the SolutionInn App