Question

Design a class named AutomobileLoan that holds a loan number, make and model of automobile, and...

Design a class named AutomobileLoan that holds a loan number, make and model of automobile, and balance. Include methods to set values for each data field and a method that displays all the loan information.

-Complete the flowchart and pseudocode that defines the class.

Make a working version of this program in Python.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE IN PYTHON:

class AutomobileLoan:

def __init__(self,loanNumber,make,model,balance):

self.loanNumber = loanNumber

self.make = make

self.model = model

self.balance = balance

def setLoanNUmber(self,loanNumber):

self.loanNumber = loanNumber

def setMake(self,make):

self.make = make

def setModel(self,model):

self.model = model

def setBalance(self,balance):

self.balance = balance

def info(self):

print("Loan number:",self.loanNumber)

print("Make:",self.make)

print("model:",self.model)

print("balance:",self.balance)

mob = AutomobileLoan(1234,"swift","benz",1000000)

mob.info()

INDENTATION:

HD HD I 12:25 new* 1 class AutomobileLoan: def_init_(self,loanNumber,make, model,balance): self.loanNumber loanNumber 2 self.

OUTPUT:

HD HD 12:25 ТАВ Loan number: 1234 Make: swift model: benz balance: 1000000 [Program finished] 3 4 5 6 7 8 9 1 2 i t у и qw е

Add a comment
Know the answer?
Add Answer to:
Design a class named AutomobileLoan that holds a loan number, make and model of automobile, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Design a class named EmployeeRecord that holds an employee’s ID number, name, and payrate. Include mutator...

    Design a class named EmployeeRecord that holds an employee’s ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that defines the class and implements the mutator methods. need help please with this question

  • Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock...

    Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, and price per share. Include methods to set and get the values for each data field. Design an application that declares two StockTransaction objects and sets and displays their values. Design an application that declares an array of 15 StockTransaction objects. Prompt the user for data for each object, and then display all the values. Design an application that declares an array of...

  • python Design a class named Car that has the following fields: yearModel: The yearModel field is...

    python Design a class named Car that has the following fields: yearModel: The yearModel field is an Integer that holds the car’s year model. make: The make field references a String that holds the make of the car. speed: The speed field is an Integer that holds the car’s current speed. In addition, the class should have the following constructor and other methods: Constructor: The constructor should accept the car’s year model and make as arguments. These values should be...

  • Design a class named Person with fields for holding a person's name, address, and telephone number...

    Design a class named Person with fields for holding a person's name, address, and telephone number (all as Strings). Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person class. The Customer class should have a String field for the customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write a constructor that initializes...

  • MAKE IT DIFFERENT WAYS TO RUN IT: Design an application for each of the following problems...

    MAKE IT DIFFERENT WAYS TO RUN IT: Design an application for each of the following problems writing the pseudocode for each; include a UML diagram if appropriate. Be sure to follow the CSI 117 Style Criteria for naming conventions, class diagrams, pseudocode, keywords, and operators. 1. Wood Trim, Inc. wants a program that will allow its sales clerks to enter the length (in feet) of the trim ordered by a customer and the price of one foot of trim. Design...

  • a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number,...

    a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number, monthly rent amount, and term of the lease in months. Include a constructor that initializes the name. "XXX", the apartment number to O, the rent to 1000, and the term to 12. Also include methods to get and set each of the fields. Include a nonstatic method named addPetFee() that adds $10 to the monthly rent value and calls a static method named explainPetPolicy...

  • Programming Using Python>>>>>>>>>>>>>>>>>>>>>>>> (Algebra: linear equations) Design a class named LinearEquation for 2x2 a system of...

    Programming Using Python>>>>>>>>>>>>>>>>>>>>>>>> (Algebra: linear equations) Design a class named LinearEquation for 2x2 a system of linear equations: The class contains: ? The private data fields a, b, c, d, e, and f with get methods. ? A constructor with the arguments for a, b, c, d, e, and f. ? Six get methods for a, b, c, d, e, and f. ? A method named isSolvable() that returns true if is not 0. ? The methods getX() and getY()...

  • Use Python Programming. Design a class named Quadratic Equation for a quadratic equation ax + bx+c...

    Use Python Programming. Design a class named Quadratic Equation for a quadratic equation ax + bx+c 0. The class contains: • The data fields a, b, and c that represent three coefficients. . An initializer for the arguments for a, b, and c. • Three getter methods for a, b, and c. • A method named get Discriminant() that returns the discriminant, which is b- 4ac The methods named getRoot 1() and getRoot 2() for returning the two roots of...

  • java Write a class named Car that has the following fields: • yearModel: The yearModel field...

    java Write a class named Car that has the following fields: • yearModel: The yearModel field is an int that holds the car's year model. • make: The make field is a String object that holds the make of the car. • speed: The speed field is an int that holds the car's current speed. In addition, the class should have the following methods: • Constructor: The constructor should accept the car's year model and make as arguments. These values...

  • (The Triangle class) Design a class named Triangle that extends the GeometricObject class. The Triangle class...

    (The Triangle class) Design a class named Triangle that extends the GeometricObject class. The Triangle class contains: - Three float data fields named side1, side2, and side3 to denote the three sides of the triangle. - A constructor that creates a triangle with the specified side1, side2, and side3 with default values 1.0. - The accessor methods for all three data fields. - A method named getArea() that returns the area of this triangle. - A method named getPerimeter() that...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT