1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vika [28.1K]
2 years ago
11

Write the definition of a class Phone containing: 1. A data member named model of type string. 2. A data member named partNumber

of type string. 3. A data member named retailPrice of type double 4. A void method to display the fields model, partNumber, and retailPrice on the standard output.
Computers and Technology
1 answer:
Nady [450]2 years ago
4 0

Answer:

class Phone(object):

   def __init__(self, model, partNumber, retailPrice):

       self.model = model

       self.part_number = partNumber

       self.retail_price = retailPrice

   def phone_specs(self):

       print( "Phone model: {}\nPart number: {}\nRetail price: {}".format( self.model, self.part_number, self.retail_price))

phone1 = Phone("Nokia", "asd234", 200.0)

phone1.phone_specs()

Explanation:

A class is a blueprint of a data structure used to create objects of the same data types and methods. The Phone class is an object that creates an instance of the phone1 object. The phone_specs method is used to display the details of the phone1 object.

You might be interested in
Write a filter that reads in a sequence of integers and prints the integers, removing repeated values that appear consecutively.
lara31 [8.8K]

Answer:

Following is the code for filter:

public class filter

{ public static void main(String[] args)

{ int x = StdIn.readInt();

System.out.print(" " + x + " ");

while(!StdIn.isEmpty())

{ int y = StdIn.readInt();

    if(y != x)

          System.out.print(" " + y + " ");

    x = y;

    }

    }

    }

Explanation:

  • A public class filter is used.
  • The main function will accept a single argument as string[], it is also known as java command line argument.
  • Now the Stdln.readInt is used to read the integers in the sequence and store it in integer x.
  • The value stored in variable x will be printed using System.out.print
  • Now unless the Stdln.readInt gets an empty value, check each value of sequence and store in variable y.
  • If y is not equal to previous value x, print it and shift the value of y into x.
  • Repeat the loop again.

i hope it will help you!

7 0
3 years ago
Read 2 more answers
Jake was working on an essay for his English class on a stormy Sunday afternoon. Before he could save his document, a big strike
matrenka [14]

Maybe in atosave, Computers mostly save what your working on :3

8 0
3 years ago
Lonnie has several workbooks that contain financial and sales data. He needs to ensure that if the data in a single cell in one
Rzqust [24]

Answer: Linked cell

Explanation: I just did a test

7 0
3 years ago
In a network, a computer that performs specific services for other computers on the network is called a
klio [65]
Motherboard or main sequence processor 
(either that  a mainframe or a server)
hope this helps

8 0
3 years ago
Inputting a range of numbers comprising a batch and then inputting each serially numbered document is characteristic of the cont
Fynjy0 [20]

Answer:

batch sequence check.

Explanation:

A batch sequence check can be defined as a strategic and systematic control plan which typically involves the process of inputting a range of numbers comprising a batch and then inputting each serially numbered document.

The steps for checking an event data within a batch using a batch sequence check include the following;

I. You'll enter a range of serial numbers of the document in a batch.

II. You'll enter each serially pre-numbered document one after the other.

III. The input documents are sorted by a computer into a serial (numerical) order, match the sequence number range against the input documents, and then reports any part of the document that is missing, a duplicate and out of range.

6 0
3 years ago
Other questions:
  • By applying styles formats are being applied ?
    14·2 answers
  • Why is exception handling an issue for testers in object-oriented developments?
    15·1 answer
  • PLEASE HELP!!!!! MUCH OBLIGED!!!!
    15·1 answer
  • Look up and list the number of a local taxi or car service in your community. Include the company name and telephone number.
    13·1 answer
  • You start up your laptop while getting a coffee across the room. You hear the usual chimes and doinks as it starts up. When you
    14·2 answers
  • Order the steps to take when drawing electron dot diagrams.
    15·2 answers
  • In a registration database, Ross has tables for student, professor, classroom, class, class-hour. Since his campus has about 12,
    9·1 answer
  • The first project that this position will work on is an embedded sensor that will send readings periodically to the cloud, and h
    9·1 answer
  • In your own words, describe how a network administrator can use the OSI model to isolate a network problem.
    13·1 answer
  • Python code 100 Random Numbers (twice)
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!