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
Jlenok [28]
3 years ago
13

Suppose we define a WaitlistEntry as follows:

Computers and Technology
1 answer:
kati45 [8]3 years ago
8 0

Answer:

You have syntax errors, but I don't know if it happened when you posted this question, nevertheless

Explanation:

Correct code:

WaitlistEntry createWL( int iPriority, int iStudentID ) { // Opening Brace

WaitlistEntry w; // Should be ; not ,

w.iPriority = iPriority;   // Assign Missing

w.iStudentID = iStudentID; // Assign Missing

return w;

} // Closing Brace

// Also note: iStudentID this actually has an 'l' which is LD. Not ID, this is why I assume these errors happened when posting the question.

You might be interested in
Imagine that you have access to a class named MyCircle that has void setRadius(double r) and double getRadius() methods. Write a
Nikitich [7]

Code for the method described in the question in java:

public static double averageRadius(MyCircle[] myCircles) {

       double sum = 0;

       for (MyCircle myCircle: myCircles) {

           if(myCircle.getRadius() < 0) myCircle.setRadius(0);

           sum += myCircle.getRadius();

       }

       return sum / myCircles.length;

   }

And the complete program:

import java.util.Random;

public class MyCircle {

   private double radius;

   public double getRadius() {

       return radius;

   }

   public void setRadius(double radius) {

       this.radius = radius;

   }

   public static double averageRadius(MyCircle[] myCircles) {

       double sum = 0;

       for (MyCircle myCircle: myCircles) {

           if(myCircle.getRadius() < 0) myCircle.setRadius(0);

           sum += myCircle.getRadius();

       }

       return sum / myCircles.length;

   }

   public static void main(String[] args) {

       Random random = new Random();

       int N = 10;

       MyCircle[] myCircles = new MyCircle[N];

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

           myCircles[i] = new MyCircle();

           myCircles[i].setRadius(random.nextInt(100));

           System.out.printf("Created MyCircle %d with radius %.2f \n", i, myCircles[i].getRadius());

       }

       System.out.printf("\nAverage radius of %d circles is %.2f \n", N, MyCircle.averageRadius(myCircles));

   }

}

The output was:

Created MyCircle 0 with radius 76.00

Created MyCircle 1 with radius 86.00

Created MyCircle 2 with radius 38.00

Created MyCircle 3 with radius 4.00

Created MyCircle 4 with radius 8.00

Created MyCircle 5 with radius 39.00

Created MyCircle 6 with radius 77.00

Created MyCircle 7 with radius 78.00

Created MyCircle 8 with radius 39.00

Created MyCircle 9 with radius 46.00

Average radius of 10 circles is 49.10

7 0
3 years ago
Which of the following statements about relays is correct? A. A relay is a type of rheostat. B. A normally closed relay closes a
Sloan [31]
C. A relay is an electrical switch that works through electromagnetism. 
3 0
3 years ago
Read 2 more answers
Can you plz type down a word.
ivanzaharov [21]

Answer:

ok? ok? ok? ok? ok? ok? ok? ok? ok?

5 0
3 years ago
Read 2 more answers
___________ are the constant values that are used in a program. ​
77julia77 [94]

Answer: Data

Explanation:

3 0
3 years ago
Natural language generation is focused on?
Mila [183]

While natural language understanding focuses on computer reading comprehension, natural language generation enables computers to write. NLG is the process of producing a human language text response based on some data input. This text can also be converted into a speech format through text-to-speech services.

<em>-</em><em> </em><em>BRAINLIEST</em><em> answerer</em>

6 0
3 years ago
Other questions:
  • When technology advances which of the following always takes place?
    6·2 answers
  • According to Fourman, Informatics is _______________ with a very _____________ scope.
    5·2 answers
  • Give two reasons to break up
    11·2 answers
  • 5.) Spam messages account for what percentage of all email?
    15·2 answers
  • Jason works as a financial investment advisor. He collects financial data from clients, processes the data online to calculate t
    14·1 answer
  • Point out the correct statement:_____.
    6·1 answer
  • Assume that the variable data refers to the list [5, 3, 7]. Write the expressions that perform the following tasks: a. Replace t
    8·1 answer
  • Differentiate between email and NIPOST System
    12·1 answer
  • 1. What is the difference between the wireless network that you provide to your customers versus the wireless network that you w
    5·1 answer
  • What is the complete path and filename of the file where ports and their associated protocols are defined
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!