1. All work must be done in Replit - Final Exam project. As you work, an...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. All work must be done in Replit - Final Exam project. As you work, an audit trail is being maintained to check for potential cheating. To avoid problems, do ALL WORK in the Final Exam replit. • Due to time constraint, this exam will be especially difficult for most students. You are not expected to to get everything perfect, but you should be able to do most of the work. • You will get partial credit. I also curve my exams. I will not know the curve until all the grading is finished for the entire semester. . I will post your grades on CUNY first by December 23 2. Use import statements as needed to make this application work. (2 points) 3. For file handling, use Open and Close statements as appropriate. (2 points) 4. You will ask the user to enter the following data: . • id: Any string is valid. Remove any leading or trailing spaces before assigning the value to the variable. In other words, all the work must be done in one line. (2 points) • price: Any decimal or integer number. Any conversion should be done before assigning the variable a value. In other words, all the work must be done in one line. (2 points) • color: This is a string input. You must convert it to UPPER CASE using Python's built-in functions before assigning it to the variable. Also, remove any leading or trailing spaces before assigning the value to the variable. In other words, all the work must be done in one line. (3 points) • If the user does not enter a valid value for id, the program should immediately exit and give an error message. (2 points) • If the user does not enter a valid value for color, the program should immediately exit and give an error message. (2 points) 5. Create a variable for internal use by your program. (1 points) • Create a variable called FILENAME. Keep it in uppercase as shown. Assign this variable the value: item-data.txt • The user of your application should not be able to 6. Once the user has provided valid inputs, then save the values to a text file. ● If this file already exists, new data should be added to it at the end. If this files does not exist, it should be automatically created. (3 points) The file name should reference the FILENAME ● variable created earlier (3 points) • You will ensure that each inventory item is in its own line. No two inventory items should be on the same linc (3 points) 7. After the data has been saved to the file, display an appropriate message to the user. (1 points) 8. Print a message saying: Retrieving Existing Data (1 points) 9. Read the data from the previously created file. Using a loop, read and display the entire contents of the file ONE LINE AT A TIME. (5 points) 10. Add some dummy data. (3 points) 1. All work must be done in Replit - Final Exam project. As you work, an audit trail is being maintained to check for potential cheating. To avoid problems, do ALL WORK in the Final Exam replit. • Due to time constraint, this exam will be especially difficult for most students. You are not expected to to get everything perfect, but you should be able to do most of the work. • You will get partial credit. I also curve my exams. I will not know the curve until all the grading is finished for the entire semester. . I will post your grades on CUNY first by December 23 2. Use import statements as needed to make this application work. (2 points) 3. For file handling, use Open and Close statements as appropriate. (2 points) 4. You will ask the user to enter the following data: . • id: Any string is valid. Remove any leading or trailing spaces before assigning the value to the variable. In other words, all the work must be done in one line. (2 points) • price: Any decimal or integer number. Any conversion should be done before assigning the variable a value. In other words, all the work must be done in one line. (2 points) • color: This is a string input. You must convert it to UPPER CASE using Python's built-in functions before assigning it to the variable. Also, remove any leading or trailing spaces before assigning the value to the variable. In other words, all the work must be done in one line. (3 points) • If the user does not enter a valid value for id, the program should immediately exit and give an error message. (2 points) • If the user does not enter a valid value for color, the program should immediately exit and give an error message. (2 points) 5. Create a variable for internal use by your program. (1 points) • Create a variable called FILENAME. Keep it in uppercase as shown. Assign this variable the value: item-data.txt • The user of your application should not be able to 6. Once the user has provided valid inputs, then save the values to a text file. ● If this file already exists, new data should be added to it at the end. If this files does not exist, it should be automatically created. (3 points) The file name should reference the FILENAME ● variable created earlier (3 points) • You will ensure that each inventory item is in its own line. No two inventory items should be on the same linc (3 points) 7. After the data has been saved to the file, display an appropriate message to the user. (1 points) 8. Print a message saying: Retrieving Existing Data (1 points) 9. Read the data from the previously created file. Using a loop, read and display the entire contents of the file ONE LINE AT A TIME. (5 points) 10. Add some dummy data. (3 points)
Expert Answer:
Answer rating: 100% (QA)
To accomplish these tasks you can use Pythons builtin input function to get user input and the tryex... View the full answer
Related Book For
University Physics with Modern Physics
ISBN: 978-0133977981
14th edition
Authors: Hugh D. Young, Roger A. Freedman
Posted Date:
Students also viewed these accounting questions
-
Use import statements as needed to make this application work. (2 points) For file handling, use Open and Close statements as appropriate. (2 points) You will ask the user to enter the following...
-
How much work must be done by a Carnot refrigerator to transfer 1.0 J as heat? (a) From a reservoir at7.0 o C to one at 27 o C, (b) From a reservoir at -73 o C to one at27 o C, (c) From a reservoir...
-
How much work must be done by a Carnot refrigerator to transfer 1.00 J as heat (a) from a reservoir at 5.70C to one at 24.0C, (b) from a reservoir at -73.0C to one at 24.0C, (c) from a reservoir at...
-
Given a shaky economy and high heating costs, more and more households are struggling to pay utility bills (The Wall Street Journal, February, 14, 2008). Particularly hard hit are households with...
-
Business writer Tom Peters has suggested that in making process changes, we should Try it, test it, and get on with it. How does this square with the DMAIC/Continuous Improvement philosophy?
-
Evaluate the role of the marketing mix in the Olympus introduction.
-
For the circuit of Figure P23.39, a. What is the equivalent capacitance? b. What is the charge of each of the capacitors? 12 V FIGURE P23.39 HHHH 4.0 F 2.0F 1.0 F
-
Why might Mattel set a much lower contribution margin on its Barbie dolls than on the accessories for the dolls?
-
Solve the equation. (Give an exact answer. 7x 4 - 1 1 -- 2/(x - 1/4)
-
Hastings Company bases its variable overhead performance report on the actual direct labour- hours of the period. Data concerning the most recent year, which ended on December 31, are as follows:...
-
Summarize the total costs to account for, calculate the cost per equivalent unit for direct materials and conversion costs, and assign costs to the units completed (and transferred out) and units in...
-
What would be the LEAST concerning factor for an individual who has purchased a fixed, non-indexed joint and last survivor life annuity?
-
7. (3 points) Among other things, Instagram and Facebook introduced platforms through which individ- ual cheerleaders could publicize themselves, or advertise for complementary services (e.g.,...
-
The Article: Development, Implementation, and Results from a COVID19 Messaging Campaign to Promote Health Care Seeking Behaviors Among Community Clinic Patients read the article and please help me...
-
Rank the seven factors listed below in order from the most influential (7) to the least influential (1) parenting factors that make children at risk for substance abuse problems. Explain your...
-
Show that the expression v = vi+ at is dimensionally correct, where v and vi represent speed, a is acceleration, and t is time interval.
-
The firm has the following information; Sales of $191,760 4 Cost of goods sold of $139,964 The operating income (EBIT) is $5,000 There are 4,321 shares outstanding. What is the firm's gross profit...
-
Suppose the spot and six-month forward rates on the Norwegian krone are Kr 5.78 and Kr 5.86, respectively. The annual risk-free rate in the United States is 3.8 percent, and the annual risk-free rate...
-
In some household air conditioners used in dry climates, air is cooled by blowing it through a water-soaked filter, evaporating some of the water. How does this cool the air? Would such a system work...
-
In Eq. (43.11), as the total number of nucleons becomes larger, the importance of the second term in the equation decreases relative to that of the first term. Does this make physical sense? Explain....
-
What is the momentum of one drop of water immediately after it leaves the fishs mouth? (a) 7.5 10 -4 kg m/s; (b) 1.5 10 -4 kg m/s; (c) 7.5 10 -3 kg m/s; (d) 1.5 10 -3 kg m/s. Archerfish are...
-
1. An analyst is estimating the intrinsic value of a new company. The analyst has one year of financial statements for the company and has calculated the average values of a variety of price...
-
Case 1: Noncallable, Nonconvertible, Perpetual Preferred Shares The following facts concerning the Union Electric Company 4.75 percent perpetual preferred shares (CUSIP identifier: 906548821) are as...
-
For the next three years, the annual dividends of a stock are expected to be 2.00, 2.10, and 2.20. The stock price is expected to be h20.00 at the end of three years. If the required rate of return...
Study smarter with the SolutionInn App