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
julsineya [31]
3 years ago
12

"Write a class named Car that has the following data attributes:" _ _year_model (for the car’s year model) _ _make (for the make

of the car) _ _speed (for the car’s current speed)
Computers and Technology
1 answer:
UkoKoshka [18]3 years ago
6 0

Answer:

public class Car {

   private String __year_model;

   private String __make;

   private int __speed;

   //Creating the constructor

   public Car(String __year_model, String __make, int __speed) {

       this.__year_model = __year_model;

       this.__make = __make;

       this.__speed = __speed;

   }

   //Creatining the set and get methods

   public String get__year_model() {

       return __year_model;

   }

   public void set__year_model(String __year_model) {

       this.__year_model = __year_model;

   }

   public String get__make() {

       return __make;

   }

   public void set__make(String __make) {

       this.__make = __make;

   }

   public int get__speed() {

       return __speed;

   }

   public void set__speed(int __speed) {

       this.__speed = __speed;

   }

}

Explanation:

As stated in the question, The class Car is created using Java programming language with the three attributes year_model, make and speed.

Constructors as well as set and get methods were also created for each of the fields.

You might be interested in
While engineers work to create computers that can understand us emotionally, ________ are also evolving toward a more human appe
aleksandrvk [35]
While engineers work to create computers that can understand us emotionally, ________ are also evolving toward a more human appearance.

affecting computing techniques
8 0
3 years ago
Dynamically allocatе mеmory for a DNA objеct and storе its addrеss in a variablе namеd dnaPtr
borishaifa [10]

Answer:

 DNA obj =new DNA;//obj object created dynamically.

   DNA *dnaPtr=&obj.//dnaPtr to store the address of the object.

Explanation:

The above written statements are in C++.The DNA object is created dynamically and it is done in C++ by using new keyword which allocates the heap memory for the object.

Then a dnaPtr is created of type DNA so that it can store the address of the DNA objects.

4 0
2 years ago
What is computing networking​
andre [41]
A computer network is a group of computers that use a set of common communication protocols over digital interconnections for the purpose of sharing resources located on or provided by the network nodes.
6 0
3 years ago
A firewall can consist of all devices positioned on the network _____________.
ale4655 [162]

Answer:

The answer to this question is "perimeter".

Explanation:

In computer science, the firewall is used to provide a network security system that manages network traffic like incoming and outgoing signals. This traffics is based on predetermined security rules. The firewall typically installs a boundary between a trusted inner network and an untrusted outer network, such as the Internet. It is a software concept and Perimeter firewalls manage the flow of network traffic and host or organization's border the boundary that provides the first line of security against outer attacks and blocking access to inappropriate content from inside an organization.

6 0
3 years ago
"Players The files SomePlayers.txt initially contains the names of 30 football play- ers. Write a program that deletes those pla
kumpel [21]

Answer:

I am writing a Python program that deletes players from the file whose names whose names do not begin with a vowel which means their names begin with a consonant instead. Since the SomePlayers.txt is not provided so i am creating this file. You can simply use this program on your own file.

fileobj= open('SomePlayers.txt', 'r')  

player_names=[name.rstrip() for name in fileobj]  

fileobj.close()  

vowels = ('a', 'e', 'i', 'o', 'u','A','E','I','O','U')

player_names=[name for name in player_names  

                     if name[0] in vowels]

fileobj.close()

print(player_names)

Explanation:

I will explain the program line by line.

First SomePlayers.txt is opened in r mode which is read mode using open() method. fileobj is the name of the file object created to access or manipulate the SomePlayers.txt file. Next a for loop is used to move through each string in the text file and rstrip() method is used to remove white spaces from the text file and stores the names in player_names. Next the file is closed using close() method. Next vowels holds the list of characters which are vowels including both the upper and lower case vowels.

player_names=[name for name in player_names  

                     if name[0] in vowels]

This is the main line of the code. The for loop traverses through every name string in the text file SomePlayers.txt which was first stored in player_names when rstrip() method was used. Now the IF condition checks the first character of each name string. [0] is the index position of the first character of each players name. So the if condition checks if the first character of the name is a vowel or not. in keyword is used here to check if the vowel is included in the first character of every name in the file. This will separate all the names that begins with a vowel and stores in the list player_names. At the end the print statement print(player_names) displays all the names included in the player_names which begin with a vowel hence removing all those names do not begin with a vowel.

8 0
3 years ago
Other questions:
  • What is the one common feature that ties together different social media technologies? All of the social media tools we use toda
    5·2 answers
  • Rachel works in a bank. She wants to present the idea of implementing an IS to the management. How should Rachel describe the IS
    9·2 answers
  • A loop that repeats a specific number of times is known as a(n):
    9·1 answer
  • Storing a value in a variable<br> Exponent<br> Variable<br> Assignment<br> Operator
    13·1 answer
  • A system that monitors network use for potential hacking attempts and takes preventative action to block, isolate, or identify a
    11·1 answer
  • Whats the best c++ compiler
    9·1 answer
  • If a speed mismatch was configured between two Cisco routers' Ethernet interfaces, what would the status of this interface be?
    12·1 answer
  • A range check that can be used in Microsoft access to calculate the data collected which is date and time
    10·1 answer
  • How will you identify a file type on your computer?
    5·1 answer
  • Your friend Cameron’s little sister is visually impaired. Cameron is worried that his sister will not be able to use technology
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!