Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

B. Consider a problem to find the student who had the highest GPA for the 2020/2021 academic year. Using the below data set, answer the questions that follow: StudentGPA[2,2.5,4,4,4,3,3.5,3.3,3.1,2.1] i. Explain how a binary search algorithm can be used to solve this problem. [2.5 marks] ii. Explain how a sorting algorithm can be used to solve this problem. [2.5 marks] iii. Write the algorithm using the binary implementation. [2.5 marks] iv. Write the algorithm using the sorting implementation. [2.5 marks


"use strict";



process.stdin.on("end", (_) => {

 inputString = inputString.trim().split("\n").map((str) => str.trim());

 main();

});


function readLine() {

 return inputString[currentLine++];

}


/* Please do not modify anything above this line */


class Submarine {

 constructor() {

  this.isSubmerged = false;

 }


 /* Write your code here */

}


class WeaponUnit extends Submarine {

  

 /* Write your code here */


}


/* Please do not modify anything below this line */


function main() {

 const totalTorpedos = parseInt(readLine());

 const torpedosFired = parseInt(readLine());  

  

 const weaponUnit1 = new WeaponUnit(totalTorpedos, torpedosFired);

  

 weaponUnit1.dive();

 weaponUnit1.fireTorpedos();

 weaponUnit1.surface();

}


Write a program that reads integers from the user and stores them in a list. Yourprogram should continue reading values until the user enters 0. Then it should display all of the values entered by the user (except for the 0) in order from smallest to largest,with one value appearing on each line. 


Why are open standards important for protocols?


What are the basic communications tasks that define networking as described in the class lecture? 


 Write a program ( using loop ) that reads five marks and computes the average. Use the sample code from today’s lesson on adding three numbers to help you get started. 

 

b) Modify the program to also output the lowest and highest mark. 

 

c) Modify the program to check if the mark entered is between 0 and 100. 

 

d) Modify the program to ask the user to enter -1 when done entering marks. 

 

e) Write the same program using Try and except statement  



 Write a program using function called remove_duplicates that takes a list and returns a new list with only the unique elements from the original list. For example remove_duplicates([1, 2, 3, 3, 4, 2, 1, 5]) would return [1, 2, 3, 4, 5]. 


Write a program using function called cumulative_sum that takes a list of numbers and returns the cumulative sum; that is, a new list where the nth element is the sum of the first n elements from the original list. For example, the cumulative sum of [1, 2, 3] is [1, 3, 6]. 


  1. Write a pseudocode a function called fibonacci that determines the first n terms of the Fibonacci sequence. The function should take n as an argument and return a list of the first n terms of the Fibonacci sequence. 

 


What are the applications of spreadsheet.


LATEST TUTORIALS
APPROVED BY CLIENTS