Programming Challenge: 10 - Miles Per Gallon Rather then hard-code the values for miles and gallons, prompt the user for this information and accept it using cin statements as shown in class. Make sure you use the appropriate data type for miles and gallons! Deliverables: A C++ program file entitled PC2-10.cpp containing the source code to Programming Challenge 10. An image entitled PC2-10.xxx containing the screen shot for Programming Challenge 10 where the file type xxx is be the image file format of your choice (jpg, png, bmp, whatever). If possible, show the screen shot over the code, as demonstrated in class. There should not be an actual "xxx" in your file name, that just stands in for the file type, which will be png or jpg or whatever. Make sure your screen shot is black text on a white screen, as per the homework submission instructions. Use inputs 325 miles and 15.5 gallons for your screen shot. Check List: Did you name your .cpp file exactly as specified on Moodle? • Is your name at the top of your code, as shown in the programming examples? Did you use the appropriate data type for your variables? Did you make appropriate use of comments within your code? Did you include a screen shot using the designated inputs? Is that screen shot set to dark text on a light background? • See the "How to submit..." document for instructions on this. Does that screen shot have an "XXX" anywhere in the file name? • The answer to that question should be "NO!" Did you copy any portion of your homework from the web, a group chat, or an Al tool such as ChatGPT? • The answer to that question should also be "NO!" • Did you use features of C++ not yet covered in class? • For the third time, "NO!"
Added by M-Nica A.
Close
Step 1
Is it due to a lack of resources, conflicting priorities, or some other reason? Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 80 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program to compute numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student’s last name, then one space, followed by the student’s first name, then one space, then ten or fewer quiz scores. (If there are fewer than ten scores, that means the student missed one or more quizzes.) The quiz scores are whole numbers and are separated by one space. Your program will take its input from this file and send its output to a second file. The data in the output file will be the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student’s quiz scores. The average score is the sum of the quiz scores divided by 10. This amounts to giving the student a 0 for any missed quiz. The output file will contain a line (or lines) at the beginning of the file explaining the output. Use formatting instructions to make the layout neat and easy to read. After placing the desired output in an output file, your program will close all files and then copy the contents of the output file to the input file so that the net effect is to change the contents of the input file. Use at least two functions that have file streams as all of some of their arguments.Hint: Check out putback member function. See topic in Files menu.SAMPLE OUTPUT Input file:test_ line_ 10 20 30 40 50 60 70Price Betty 40 50 60 70 60 50 30 60 90Goodman John 60 70 80 90 100 90Smith Charles 70 80 90 60 70 60 80 90 90 90Spangenberg Ward 70 70 80 90 70 80 90 80 70 60Output file:Last Name, First Name, up to 10 quiz scores. last entry is the average.test_ line_ 10 20 30 40 50 60 70 28.00Price Betty 40 50 60 70 60 50 30 60 90 51.00Goodman John 60 70 80 90 100 90 49.00Smith Charles 70 80 90 60 70 60 80 90 90 90 78.00Spangenberg Ward 70 70 80 90 70 80 90 80 70 60 76.00 Point Distribution:-50 Does not compile-5 Warnings-5 No description multiple line comments (name, date, etc)-5 No single line comments (logic, input, output, etc)-20 Does not use at least 2 programmer defined functions with stream passing. -10 Does not copy output file to input file-10 Does not format output
Akash M.
CIN 635 - MOBILE COMPUTING – SEMESTER 2, 2023 ASSIGNMENT 1 – 5% TOTAL MARK – 30 Objective: The aim of this assignment is to allow the students to develop a simple mobile application using the Visual Basic approach, which would have potential real-world usage for a mobile device. You will gain an understanding of developing an application within the programming knowledge and skills learned using the B4A environment. Thus, this assignment requires students to come up with a proposal (pair work) for their major project. Assignment 1 Requirements: 1. Propose an application that you will be developing. Give the title and a brief description of the application, scope, and deliverables. 2. Design a wireframe using appropriate tools such as Lucidchart, Figma, Pencil Project, etc. 3. You may use the following format to complete your assignment. - Title page - Content pages – proposed title of your application, scope, deliverables, wireframe, Gantt chart, and provide reasoning for developing this application. - Reference. Standard format for Documentation: Font Size: 12 Font Type: Times New Roman Line Spacing: 1.5 Due Date: 1st September 2023
CST-105: Exercise 4 The following exercise assesses your ability to do the following: • Design a logical solution using control structures. • Utilize repetition structures in a programming solution. • Use file input and output operations in a programming solution 1. Review the rubric for this assignment before beginning work. Be sure you are familiar with the criteria for successful completion. The rubric link can be found in the digital classroom under the assignment. 2. Design a flowchart for a program that tabulates contributions collected by an organization. The organization wishes to accept contributions until a total of $10,000,000 is met. Once this total is hit, no further contributions should be accepted. The organization wants the program to read data from an input file (input.in). The following data should be written to a file called results.out a. The total number of contributions needed to meet the goal of 10 million dollars b. The amount of the largest and smallest contribution accepted c. The average contribution size d. The final total of the contributions accepted 3. Implement (code) and test your program with a variety of input data. It is helpful to set a smaller contribution goal when testing your program. Consider both the scenario where the input file does not contain enough contributions to meet the goal and the scenario where the input file contains more data than needed. The output file should match the formatting shown in the example. 4. Make a video of your project. In your video, run your program and discuss your solution, being sure to explain any interesting computations. Your video should not exceed 3 minutes. Submit the following in the digital classroom, as directed by your instructor: • Your flowchart (.png file) • A text file that contains ◦ A link to your video ◦ Your .java code
Supreeta N.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD