Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 10, Problem 5PE
Program Plan Intro

Adding method “addGrade()”

Program Plan:

  • Import the required packages.
  • Definition of class Student.
    • Definition of “__init__” method.
      • Set the name, hours and quality points..
    • Definition of “getName()”.
      • Return the name.
    • Definition of “GetHours()”.
      • Return the hours.
    • Definition of “getQPoints()”
      • Return the quality points.
    • Definition of “gpa()”.
      • Return the “gpa”.
    • Definition of “addGrade()”.
      • Calculate the number of hours attended.
      • Calculate the grade points.
    • Definition of “makeStudent()”.
      • Return the name, hours and quality points of the student.
  • Declare a main function. Inside the main function,
    • Create an object for student.
    • Get the grade points and credits from the user.
    • Call the method “addGrade()”.
    • Print the result.
  • Call the main function.

Blurred answer
Students have asked these similar questions
Part 3. arange Method Define a method in simpy named arange. Its purpose is to fill in the values attribute with range of values, like the range built-in function, but in terms of floats. It has three parameters in addition to self, the last being optional: 1. start - a float indicating the first value in the range 2. stop - a float that is not included in the produced range values 3. step - a float whose default value is 1.0 that indicates how to increase (or decrease) each subsequent item in the generated range. Unlike the built- in range function, this can be a fractional, float value. Step cannot be 0.0. Think carefully about what the value of step tells you about how to design your loop(s) for this method. Before any looping, you should assert step != 0.0 to be sure you avoid an infinite loop with an invalid argument. positive = Simpy([]) positive.arange(1.0, 5.0) print("Actual: ", positive, " - Expected: Simpy([1.0, 2.0, 3.0, 4.0])") fractional = Simpy([]) positive.arange (0.0,…
Instructor note: This lab is part of the assignment for this chapter. This lab uses two Java files, LabProgram.java and SimpleCar.java. The SimpleCar class has been developed and provided to you already. You don't need to change anything in that class. Your job is to use the SimpleCar class to complete the specified tasks in the main() method of LabProgram.java Given two integers that represent the miles to drive forward and the miles to drive in reverse as user inputs, create a SimpleCar object that performs the following operations: Drives input number of miles forward Drives input number of miles in reverse Honks the horn Reports car status The SimpleCar class is found in the file SimpleCar.java. Ex: If the input is: 100 4 the output is: beep beep Car has driven: 96 miles
JAVA Problem description:You are to write a program called Seasons that prompts the user for a month and day and displays the season in which that date occurs. For reference, we will use the following date cutoffs for the various seasons: Winter December 21 – March 19 Spring March 20th – June 20th Summer June 21st – September 20th Fall September 21st – December 20th Data Validation For this program, you'll write a specific method to perform data validation based on the month and day entered. More specifically: Month – the month entered must be a valid month of the year (January – December). Day – the day entered must be a valid day for that month: January, March, May, July, August, October, December have 1-31 days. April, June, September, November have 1-30 days. February has 1-28 days (do not worry about leap years) Required program decomposition String getMonth(Scanner console) This method is called from the main method and should prompt for the month as a string…
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Java Math Library; Author: Alex Lee;https://www.youtube.com/watch?v=ufegX5o8uc4;License: Standard YouTube License, CC-BY