Question

1. Given the following leading of the question public int ti 1) What is the signature of above method( s) 2) Which of the fol


Do 1 W arm Car
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Could you plz go through this code and let me know if u need any changes in this.Thank You
_________________


1)

Ans) DetermineResult(int value1,char value2,String value3);

reason : A method signature includes method name and parameter list.

_________________________

2) c

___________________________

1)

//Zero argument Constructor

Car()

{

}

__________________________

2)

//Getters

public int getYearModel()

{

return yearModel;

}

public String getMake()

{

return make;

}

public double speed()

{

return speed;

}

_______________________

3) //setters

public void setYearModel(int yearModel)

{

this.yearModel=yearModel;

}

public void setMake(string make)

{

this.make=make;

}

___________________________

4)

//Accelerate method code

public static void accelerate()

{

this.speed+=10;

}

//Brake method code

public static void brake()

{

this.speed =speed-5;

}

_______________Could you plz rate me well.Thank You

Add a comment
Know the answer?
Add Answer to:
1. Given the following leading of the question public int ti 1) What is the signature...
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
  • 1) In the Quiz class, the foo method has the following API: public void foo( int...

    1) In the Quiz class, the foo method has the following API: public void foo( int x, String s) Which method call(s) would be correct assuming both a and y are integer values and assuming each statement is complete? a. Quiz q = new Quiz(); a = q.foo( y, “Maybe?” ); b. Quiz q = new Quiz(); q.foo( 1, “Hmmm!” ); c. Quiz q = new Quiz(); Quiz.foo( y, “You think” ); d. Both b and c 2) In the...

  • QUESTION 1 In order to print the members of structures in the array, what will be...

    QUESTION 1 In order to print the members of structures in the array, what will be the contents of blanks in the printf statement of the code snippet given below? #include <stdio.h> struct virus {    char signature[25];       char status[20]; } v[2] = {                               "Yankee Doodle", "Deadly",                               "Dark Avenger", "Killer"                   } ; void main( ) {       for (int i = 0; i < 2; i++)                   printf( "\n%s %s", _______________ , _____________ ); } A. signature, status B. v.signature,...

  • QUESTION 1 What will be displayed as a result of executing the following code? int   x...

    QUESTION 1 What will be displayed as a result of executing the following code? int   x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points    QUESTION 2 What will be the displayed when the following code...

  • 1. Answer the questions considering the following functions headers: int func1(int x, double w) double func2(string...

    1. Answer the questions considering the following functions headers: int func1(int x, double w) double func2(string I, int y, double r) char func3(int z, int s, double t, char a) a. How many parameters does function func1 have? What is the type of function func1? b. How many parameters does function func2 have? What is the type of function func22 c. How many parameters does function func3 have? What is the type of function func3? d. Write a C++ statement...

  • In problem 3, you will write a function, findvertically (), which will determine whether or not...

    In problem 3, you will write a function, findvertically (), which will determine whether or not a given word exists in a word search puzzle vertically. In word search puzzles, words can be written upwards or downwards. For example, "BEAK" appears at [1] [3] written downwards, while "BET" appears at [2] [2] written upwards: [["C", "A", "T", "X", "R"], ["D", "T", "E", "B", "L"], ["A" "R" "B", "E", "Z"], ["X", "O", "E", "A", "U"], ["J", "S", "O", "K", "W"]] Your...

  • 1. What is the output of the following code segment? int array[] = { 8, 6,...

    1. What is the output of the following code segment? int array[] = { 8, 6, 9, 7, 6, 4, 4, 5, 8, 10 }; System.out.println( "Index Value" ); for ( int i = 0; i < array.length; i++ ) System.out.printf( "%d %d\n", i, array[ i ] ); 2. What is the output of the following code segment? char sentence[] = {'H', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u' }; String output = "The sentence...

  • Question 1 1 pts Given the following heap diagram with block headers, requiring double-word alignment, and...

    Question 1 1 pts Given the following heap diagram with block headers, requiring double-word alignment, and using a next-fit placement policy: 0x 0 0 0x 08 0x 10 0x 18 0x 20 0x 28 0x 30 0x 38 0x 40 16/1 16/0 8/0 8/0 If the block at address Ox 24 was the last (most recent) allocated, what address is assigned to ptr for the heap request below: ptr malloc (2 sizeof (char) Use the same format for your answer...

  • QUESTION 1 Using the following declarations and a member of the Array class, int [ ]...

    QUESTION 1 Using the following declarations and a member of the Array class, int [ ] bArray = new int [10]; int location; Using a method in the Array class, write a statement that would change the order of the elements in the bArray array. The contents of the first cell should hold what was in the last cell. The second cell should hold what was in the next to last cell. __________________________ HINT: You must write the full statement...

  • Question 1 1 pts Which of the following is not a valid class name in Java?...

    Question 1 1 pts Which of the following is not a valid class name in Java? O MyClass MyClass1 My_Class MyClass# Question 2 1 pts Which of the following statements is False about instance variables and methods? Instance variables are usually defined with private access modifier. Instance variables are defined inside instance methods. Instance methods are invoked on an object of the class that contains the methods. A class can have more than one instance variables and methods. Question 3...

  • 0.1845 1 pts Question 13 Given the following three months of data what is the standard...

    0.1845 1 pts Question 13 Given the following three months of data what is the standard deviation? t, R t 1, 21.01% 2,-13.83% 4,088% 5.-1.32% o represent 9.15%) Express your answer in total return decimal format e.g,00915 t

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