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
Nadya [2.5K]
3 years ago
5

Write a method that finds the cheapest name of apples, and returns back a String stating what the apple name is and how much it

costs. The method should take two arrays as two parameters (you do not need to make a two dimensional array out of these arrays).
Computers and Technology
1 answer:
Korolek [52]3 years ago
7 0

The question is incomplete! Complete question along with answer and step by step explanation is provided below.

Question:

Two arrays are given:  

String apples[] = {"HoneyCrisp", "DeliciousRed", "Gala", "McIntosh",  "GrannySmith"};

double prices[] = {4.50, 3.10, 2.45, 1.50, 1.20};

Write a method that finds the cheapest name of apples, and returns back a String stating what the apple name is and how much it costs. The method should take two arrays as two parameters (you do not need to make a two dimensional array out of these arrays).

Answer:

The complete java code along with the output is prrovided below.

Java Code:

public class ApplesCheap

{

   public static String Cheapest(String apples[], double prices[])

 {

       int temp = 0;

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

    {

         if (prices[i] < prices[temp])

          {

               temp = i;

           }

       }

       return apples[temp];

   }

public static void main(String[] args)

{

// define the array of apple names and their prices

  String apples[] = {"HoneyCrisp", "DeliciousRed", "Gala", "McIntosh", "GrannySmith"};

  double prices[] = {4.50, 3.10, 2.45, 1.50, 1.20};

// print the cheapest apple by calling the function Cheapest

  System.out.println("The cheapest apple is: " + Cheapest(apples, prices));

   }

}

Output:

The cheapest apple is: GrannySmith

You might be interested in
I WILLLLL CHOOOOSEEEE YOU ASSS BRAINLESTTT!!! , HELLPPPPP MEEEE DUEEEE TODAYYYYYY!!!!
Ivenika [448]

Answer:

rohot will not start well when we try to start .....they will make a unique sound or a noise sound like something wrong inside ...reduce their body flexibility. they will not able to move or do works well..loss of jobs ..and opportunities. .

Explanation:

I hope it will help u ....

6 0
3 years ago
Read 2 more answers
Which file extension would be used to indicate a webpage document?.
mojhsa [17]

Answer:

edge I think

Explanation:

it works the best.

8 0
3 years ago
The information included in a résumé should always relate to the job objective; if it isn’t related, it shouldn’t be included.
ICE Princess25 [194]

Answer:

True.

Explanation:

A resume (curriculum vitae) can be defined as a short text-based document that a job applicant use to briefly outline his or her qualifications, abillities and accomplishments, haven completed and obtained an academic certificate. Thus, it is used to briefly outline a person's qualifications, abillities, skills set, and accomplishments, after completing and obtaining an academic certificate such as a bachelor's degree, master's degree, etc.

Generally, all job applicants are required to have a resume (curriculum vitae). This brief and concise document is always requested by human resource managers during the job application process.

Furthermore, the primary way to make a resume persuasive (to convince or inform an action in the minds of the readers - potential employers) is by customizing it to fit each company and position.

Hence, the information included in a résumé should always relate to the job objective; if it isn’t related, it shouldn’t be included.

This ultimately implies that, job applicants are expected to tailor their resume to fit or match the position that is advertised by a company's human resources department.

5 0
3 years ago
unscramble the letters to identify which step of the scientific method each statement repesents why is the sliced cheese in the
Rudiy27
Sorry the only word I could get from that is problem, is that possibly the answer?
5 0
3 years ago
Which best describes the purpose of LoJack on a computer
iris [78.8K]

Answer:The purpose of the lo jack on a computer  to the lock and delete files on the computer devices.

Explanation:The lo jack on a computer to locate all the lock and delete files.

lo jack can provides the computer on the passwords that contains different levels of the bios access.

lo jack perform on the computer operating system provides on the boot only the trusted by the computer operating system.

Lo jack computer on the function is used to the published  the exam answers on the websites.

Lo jack insures to the data into hard drives to the correct computer password.

3 0
3 years ago
Other questions:
  • If a secret key is to be used as a _________ for conventional encryption a single number must be generated.
    13·1 answer
  • Triggers are types of buttons seen in the input devices for which platform?
    14·1 answer
  • Write a while loop that prints that number doubled without reaching 100. Follow each number with a space. After the loop, print
    12·1 answer
  • Brake fluid is made up of a chemical that:
    13·2 answers
  • Secure shell (SSH) operates over which port by default
    9·1 answer
  • A common practice is to create a(n) _____ on any field that is used as a search key, in comparison operations in a conditional e
    6·1 answer
  • A Homecoming Crossword Puzzle
    12·1 answer
  • What does it mean to catch an exception?
    8·1 answer
  • Someone wanna be in a meeting with me <br><br><br> Code: rrx-ofrw-ocj
    5·2 answers
  • Choose the term that completes the sentence.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!