the language is Java! please help

Answers

Answer 1

public class Drive {

   int miles;

   int gas;

   String carType;

   public String getGas(){

       return Integer.toBinaryString(gas);

   }

   public Drive(String driveCarType){

       carType = driveCarType;

   }

   public static void main(String [] args){

       System.out.println("Hello World!");

   }

   

}

I'm pretty new to Java myself, but I think this is what you wanted. I hope this helps!


Related Questions

B1:B4 is a search table or a lookup value

Answers

Answer:

lookup value

Explanation:

Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort that array – continuously pushing the largest elements to the right side

Answers

Answer:

The solution is provided in the explanation section.

Detailed explanation is provided using comments within the code

Explanation:

import java.util.*;

public class Main {

//The Bubble sort method

public static void bb_Sort(int[] arr) {  

   int n = 10; //Length of array  

   int temp = 0; // create a temporal variable  

   for(int i=0; i < n; i++){  

         for(int j=1; j < (n-i); j++){  

           if(arr[j-1] > arr[j]){  

               // The bubble sort algorithm swaps elements  

               temp = arr[j-1];  

               arr[j-1] = arr[j];  

               arr[j] = temp;  

             }  

         }            

         }  

        }

 public static void main(String[] args) {

   //declaring the array of integers

   int [] array = new int[10];

   //Prompt user to add elements into the array

   Scanner in = new Scanner(System.in);

   //Use for loop to receive all 10 elements

   for(int i = 0; i<array.length; i++){

     System.out.println("Enter the next array Element");

     array[i] = in.nextInt();

   }

   //Print the array elements before bubble sort

   System.out.println("The Array before bubble sort");

   System.out.println(Arrays.toString(array));

   //Call bubble sort method

   bb_Sort(array);  

               

   System.out.println("Array After Bubble Sort");  

   System.out.println(Arrays.toString(array));

 }

}

Other Questions
Flavia needs to build a fence around her dog house, as illustrated on the coordinate grid below. If each unit represents 1 foot, what is the total length of Flavias fence in feet? m= -(4+ m) + 2m=whats m? Plsss helppppssssss me :< and explain thatttttt What are some of the major forces that influence the movements of the oceans? Who built the citadel of Aleppo Which expressions are equivalent to 3x + 3(x + y)?Choose all answers that apply:A 6x + 3yB 3(x + x + y)C 3ay How could you categorize or classify the five major types offorces? 12=6x+3y solve for y A colonist purchased a pair of dice, a 4 page newspaper, and placed an ad to sell a product in a newspaper. How much in todays money would that have cost? Many male anti-slavery leaders refused to support suffrage for women because A.Women in most states could already vote. b.They feared women would take control of the country. C.Most women were opposed to being granted the right to vote. d.They feared it would set back the cause of former slaves. The Fashion Store has $6000 available each month for advertising. Newspaper ads cost $200 apiece and no more than 20 can be run per month. Radio ads cost $100 each and no more than 30 can run per month. TV ads cost $800 a piece, with a maximum of 7 available each month. Approximately 1000 women will see each newspaper ad, 800 will hear each radio ad, and 14,000 will see each TV ad. How much of each type of advertising should be used if the store wants to maximize exposure? What Is It HomeWork*. What is 13 / 143 as a unit fraction State Hess' law of constant heat summation.(b) Calculate the enthalpy of formation of CH4 from the following data:i) C(s) + O2(g) CO2(g); H = -393.7 kJ/molii) H2(g) + 12 O2(g) H2O(l); H = -285.8 kJ/moliii) CH4(g) + 2 O2(g) CO2(g) + 2H2O(l); H = -890.4 kJ/mol How was DNA evidence used to prove that Dr. Sam Sheppard did not murder his wife? In a factor market, firms deliver payments in all of the following forms EXCEPT:A.rentB.profitC.loansD.wages 2. Which of the following statements is true of tertiaryconsumers in an ecosystem?A) There are more secondary consumers thantertiary consumers.B) They are caten by secondary consumers.C) They contain the most biomass out of all of thetrophievels.D) They are the largest trophic level.E) This level of the food chain has the highestamount of diversity. Simplify the algebraic expression by combining like (or similar) terms.5+9x+2 A student has a container of sand and sugar. What characteristic could be used to separate the mixture? need these 3 problems answered1.(2x-3)^2+24=02.(3x+1)^2-49=03.3x^2-12x=-45