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
Kay [80]
3 years ago
9

What number will be output by the console.log command on line 5?

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

Answer:

16

Explanation:

If you follow the line of code and add 1, 2, and then 3, 10 + 1 + 2 + 3 = 16.

Please, need Brailliest. if you need any further assistance let me know.

You might be interested in
How long will it take Lola to travel from Paris to nice?
Alisiya [41]

the answer is 5,000 hours.

I recommend you post these kind of questions in the mathematics section

4 0
4 years ago
A Musician class has been built that takes the name, number of albums sold, and number of weeks that artist has been on the Top4
MatroZZZ [7]

Answer:

See explaination for program code

Explanation:

Java code below:

Musician.java :

public class Musician {

private String name;

private int weeksInTop40;

private int albumsSold;

private boolean isPlatinum;

public Musician(String name, int weeksInTop40, int albumsSold) {

this.name = name;

this.weeksInTop40 = weeksInTop40;

this.albumsSold = albumsSold;

setPlatinum(albumsSold);

}

public void setPlatinum(int albumsSold) {

if(albumsSold >= 1000000) {

isPlatinum = true;

}else {

isPlatinum = false;

}

}

public int getWeeksInTop40() {

return this.weeksInTop40;

}

public String getName() {

return this.name;

}

public boolean getIsPlatinum() {

return this.isPlatinum;

}

public String toString() {

return this.name;

}

}

Billboard.java :

import java.util.ArrayList;

public class Billboard {

private ArrayList<Musician> top10 = new ArrayList<Musician>();

public void add(Musician newMusician) {

if(this.top10.size()<10 && newMusician.getIsPlatinum()==true) {

/**

* Less than 10 musician are present in the list currently

* And also the newMusician is platinum

* */

this.top10.add(newMusician);

}else {

if(newMusician.getIsPlatinum()==false) {

System.out.println("The new musician "+newMusician+" cannot be added because not enough records are sold");

}else {

/**

* We need to call the replace method

* */

replace(newMusician);

}

}

}

public void replace(Musician newMusician) {

/**

* First we need to find what is the lowest number of weeks

* an musician was there in top40.

* */

int lowestOnTop40 = Integer.MAX_VALUE;

int index=-1;

for(int i=0;i<this.top10.size();i++) {

if(this.top10.get(i).getWeeksInTop40()<lowestOnTop40) {

lowestOnTop40 = this.top10.get(i).getWeeksInTop40();

index = i;

}

}

/**

* We have at what position the lowest number of week on top value in variable

* lowestOnTop40 at index

* We need to compare this value with newMusician's number of weeks on top 40

* */

if(lowestOnTop40 < newMusician.getWeeksInTop40()) {

System.out.println("The old musician "+this.top10.get(index)+" has been replaced by new musician "+newMusician);

this.top10.set(index, newMusician);

}else {

System.out.println("The new musician "+newMusician+" cannot be added because not enough weeks on top40.");

}

}

public void printTop10() {

System.out.println(top10);

}

}

BillboardTester.java :

public class BillboardTester {

public static void main(String[] args) {

Billboard top10 = new Billboard();

top10.add(new Musician("Beyonce", 316, 100000000));

top10.add(new Musician("The Beatles", 365, 600000000));

top10.add(new Musician("Drake", 425, 150000000));

top10.add(new Musician("Pink Floyd", 34, 250000000));

top10.add(new Musician("Mariah Carey", 287, 200000000));

top10.add(new Musician("Rihanna", 688, 250000000));

top10.add(new Musician("Queen", 327, 170000000));

top10.add(new Musician("Ed Sheeran", 536, 150000000));

top10.add(new Musician("Katy Perry", 317, 143000000));

top10.add(new Musician("Justin Bieber", 398, 140000000));

//This musician should not be added to the top10 because they don't have enough records sold

top10.add(new Musician("Karel the Dog", 332, 60));

//This musician should replace the artist

top10.add(new Musician("Tracy the Turtle", 332, 150000000));

//This musician should not replace an artist, but is a Platinum artist

top10.add(new Musician("Alex Eacker", 100, 23400000));

top10.printTop10();

}

}

5 0
3 years ago
Write a function searchBooks which returns ALL the books written by a specific author and return the list of the book titles as
dalvyx [7]

Answer:

var library=[{author:'Bill Gates',title:'The Road Ahead',libraryID:1254},

              {author:'Abdul Kalam',title:'India 2020',libraryID:1243},

              {author:'Abdul Kalam',title:'Ignited Minds',libraryID:1200},

              {author:'Abdul Kalam',title:'Inspiring thoughts',libraryID:1200},

              {author:'Aristotle',title:'Metaphysics',libraryID:1200}

              ];

  //author of the book to be searched

  var authorName='Abdul Kalam';

  //document.write() will write in the html page

  a=searchBooks(library,authorName);

  books=a[0];

  authorNames=a[1];

  //<h1></h1> is used to make heading Books

  document.write("Books:\n");

  for(i=0;i<books.length;i++)

      document.write(books[i]['author']+" --> "+books[i]['title']+" --> "+books[i]['libraryID']+"<br>");

  document.write("Titles:\n"+a[1]);

  function searchBooks(library,authorName){

      //empty string to assign book names

      list_of_titles='';

      books=[];

      //reading each book from 0th position to last

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

          //if author is authorName then add it to list_of_titles

          if(library[i]['author']==authorName){

              books.push(library[i]);

              list_of_titles+=library[i]['title']+",";

          }

      }

      //removing the last comma

      list_of_titles=list_of_titles.slice(0,-1);

      //if list_of_titles is empty return NOTFOUND

      if(list_of_titles=='')

          return 'NOT FOUND';

      //if books are found return list_of_titles

      else

          return [books,list_of_titles];

      //returning the list of books and titles

  }

4 0
3 years ago
Ensuring the uninterrupted flow of information' describes which key communications and information systems principle?
Harlamova29_29 [7]

Answer: C) Resilience and Redundancy

Explanation:

  • According to the principle of communication and information system , redundancy is the factor that maintains the continuous flow of message or data even when failure is experienced in network by adding alternate or extra component in infrastructure for support.
  • Resilience is the factors that helps network to persist even in the state of faults by keeping the main function working and recovering the fault to maintain the flow of data.
  • Other options are incorrect because security is protection of data. Reliability factor means dependency , scalibility is changing scale of network and portability is changing position of components. Interoperability is exchanging information with devices and making use of it.
  • Thus, the correct option is option(C).

8 0
3 years ago
Read 2 more answers
What is the main purpose of QBE​
ohaa [14]

it is to give people confidence to achieve their ambitions.

Hope this Helped :T

7 0
3 years ago
Read 2 more answers
Other questions:
  • A smart refrigerator can use _____ to detect when you are running low on milk, and then send a reminder to you on a wireless net
    14·1 answer
  • The performance of a client-server system is strongly influenced by two major network characteristics: the bandwidth of the netw
    6·1 answer
  • A(n) _____ uses spatial and nonspatial data and specialized techniques for storing coordinates of networks of lines (roads, rive
    8·1 answer
  • For the past five days, the Howard family has traveled these miles: 389;126;419;93; and 394. Find the range and how. Show all yo
    8·1 answer
  • Can someone help please
    12·1 answer
  • Factors to consider while selecting a software to use​
    14·1 answer
  • Maximum number of character symbols represented by Unicode
    6·1 answer
  • Aaron is stating the main idea of what he read in his own words. He is _____.
    11·2 answers
  • Describing Work Styles for Farmworkers and Laborers, Crop
    6·2 answers
  • Need some help writing a simple PYTHON Student registration program:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!