4. A primary school is conducting a survey on the popularity of certain colours. Students ar asked to vote for any of four choices: red, blue, green, none. If red, blue or green is not the favourite, students vote for 'none'. Write an algorithm to find and print the (i) number of students that voted for EACH of the colours: red, blue green (ii) TOTAL number of students that voted for red, blue or green. Assume that on the day of the survey, 150 students are present. Also assume that all votes are valid.
Q: How does neural machine translation work in the context of language translation? Like in Google Tran...
A: The explanation of the neural machine translation work in the context of language translation is exp...
Q: Consider the function f(x) = 1 3x+1 . We approximate f(x) by the Lagrange interpolating polynomial P...
A: The Lagrangian formula: j equals 0 (xi - xj) I = 0; j 1; k 1; k 1; k 1; Because Lagrange's interpola...
Q: What is a database?
A: According to the question the database is the container to contains the data in row fact and the co...
Q: What Is SDILC?
A: Please refer below for what is SDLC and its phases:
Q: If you wanted to know the position of the letter v (i.e. return 2) in the String str containing the ...
A: We need to find the position of letter v in String str="Java"; Lets analyse given options str.indexO...
Q: Write a program to create array of objects for the same to access these. Also, make use of member fu...
A: PROGRAM EXPLANATION(C++): Create an employee class. Declare four data members ( name, age, designat...
Q: Regardless of how user level threads are implemented, if a programme has two or more user level thre...
A: Introduction: Kernel: A kernel is the heart of a computer's software or operating system. Provide a ...
Q: A processor's primary structural components should be mentioned and briefly characterised.
A: Introduction: A processor, often known as a processing unit, is a digital circuit that conducts oper...
Q: V4 packet is 1000. How many b
A: The binary value of HLEN in an IPV4 packet is 1000. How many bytes of data are transported by this p...
Q: What is the most effective method for determining the size of a software product
A: The most effective method of determining the size of a software product by comparing it with the exi...
Q: Suggest the most appropriate software process model that might be used as a basis for managing the d...
A: Answer: The agile software paradigm would be an excellent solution for all use cases since it helps ...
Q: Describe the TM that accepts the language, L= {w e{a,b,c}* | w contains equal number of a's, b's and...
A: Here in this question we have asked to describe a Turing machine that accept equal no of a , b ,c .
Q: What is ERC20? The 20th non-fungible token standard for Ethereum The first fungible token standard ...
A: What is ERC20? ERC20 is a scripting standard used within the Ethereum blockchain. An ERC20 token is...
Q: 2 Using Divide and Conquer technique, sort the given number using quick sort 9,1,3,5,2,6,4
A: quickSort(arr[], low, high) { if (low < high) { /* pi is partitioning index, arr[...
Q: Question 3 a) Write a program code to multiply two square matrices using programming language of you...
A: Given :- a) Write a program code to multiply two square matrices using programming language of your ...
Q: Write a java script program that would generate all possible combinations for a length of 3-5 charac...
A: The solution to the given problem is below.
Q: What is computer network? Describe the significance of computer network in 21st centur
A: Interconnected computer equipment that may exchange data and share resources is referred to as compu...
Q: the language, egual pu
A: If string start with a then you can see blue part. If string start with b then you can see purple pa...
Q: What is an abstract class?
A: Your answer is here given below.
Q: gorithm emonstrate, step by step, how to construct a max-heap for the list of integers 1..8] = (12, ...
A: Solution:
Q: one-dimensional array, how do you refer to all of the elements
A: here in this question we will be discuss about what is actually meaning of 1D array and how we can...
Q: Regardless of how user level threads are implemented, if a programme has two or more user level thre...
A: Introduction: Kernel: A kernel is the heart of a computer's software or operating system. Provide a ...
Q: Which of the following determines if a Forward Error Correction (FEC) scheme has even parity? O A. T...
A: Option C i.e. The number of code bits is an even number is the correct option for Forward Error cor...
Q: You are required to design a program which should allow creation of a dynamic array. User should pro...
A: The current scenario here is to write the program to calculate and display the average of all the el...
Q: What is the difference between a device drive and a network interface card?
A: Intro What is the difference between a device drive and a network interface card?
Q: Largest Gold Ingot - Problem Description Ramesh is a goldamith, who brought a large number of gold i...
A: According to the Question below the solution: Output:
Q: II. Instructions: Below is the procedure in saving the file. Fill in the missing commands in each nu...
A: The current scenario here is to fill in the blanks with the answer in the box for the procedure in s...
Q: What is an abstract class?
A: abstract class: abstract class are that class which contains both abstract and non-abstract methods ...
Q: In NumPy write a program to generate a list that contain 5 random integers in the range 1 to 100. Di...
A: Python NumPy to generate list of 5 random number of range 1to 100
Q: In JAVA programming language write a program to input the elements of two integer arrays A1, A2 of s...
A: for calculating the absolute difference, there is an inbuilt function in Math class in java, we have...
Q: Design a Java Animal class (assuming in Animal.java file) and a sub class of Animal named Cat (assum...
A: According to the information given:- We have to follow the instruction to get the desired output.
Q: An expert system is different from a database program in that only an expert system can be used:
A: Answer this question is in step 2
Q: Given an array of shape (4, 1, 3, 2) ,which of the following array-shapes are broadcast-compatible?
A: The term "broadcasting" refers to how Numpy handles arrays of differing dimensions during arithmetic...
Q: Question:: Describe the TM that accepts the language, L= {w e{a,b,c}* | w contains equal number of a...
A: Here in this question we have asked to describe a Turing machine that accept equal no of a , b ,c .
Q: The algebraic minterm for F(A,B,C) = AB + BC is: O A+C O none of these O ABC + ABC + A'BC O ABC + AB...
A: The above question is to find min terms for the given Boolean expression in which it is in the form ...
Q: sequential circuit Wi Jo K1 Qi K for the next 3 clock CYC
A:
Q: If you wanted to know the position of the letter v (i.e. return 2) in the String str containing the ...
A: A String is a pre defined class in Java which has various methods in it to perform the operations on...
Q: If you wanted to know the position of the letter v (i.e. return 2) in the String str containing the ...
A: A String is a pre defined class in Java which has various methods in it to perform the operations on...
Q: Build the following in Packet Tracer. When complete upload here. • Use network 100.100.100.0/24 as t...
A:
Q: Create a web Page using href tag having the attribute alink, vlink etc. 2. Create a web page, when ...
A: <!DOCTYPE html> <html> <head> <title> HTML body...
Q: Purpose To review more advanced aspects of user interfaces and event handlers Directions Create an i...
A: for the above interface I am using java swing I am going to use the jSlider and jTextArea. The code ...
Q: /** * This class will use Nodes to form a linked list. It implements the LIFO * (Last In First Out...
A: Here, I have to provide a complete solution to the above-given program.
Q: Describe any 50 Port Numbers and their services
A: Step 1: Port number is defined as the logical address of each application that uses the Internet to ...
Q: Write a program that prompts the user for a radius and then prints the diameter, circumference, and ...
A: logic:- display coloured message using color code 34 for blue. read radius from user display 2*ra...
Q: nums = [9,-8,7,-6,3,2,-1,3,10,9] Use enumerate to iterate through the index and values of the nums ...
A: Here is your code with an output.
Q: In a computer with a 32-bit data-bus, how many 4-bit wide memory components are used? the answer to ...
A: According to the Qestion below the Solution:
Q: Explain the difference between Harvard computer architecture and von Neumann computer architecture.
A: INtro Explain the difference between Harvard computer architecture and von Neumann computer arch...
Q: What will be the impact of the internet of things (IoT) on our everyday lives? Justify your position...
A: If we talk about the future of technology factories speaking it would be uncertain we are not sure i...
Q: .data aVal DWORD 12 bVal DWORD 13 and eax register contains 4, ebx register contains 5, and ecx regi...
A: DATA SEGMENT .data aVal DWORD 12bVal DWORD 13ENDS
Step by step
Solved in 2 steps
- In a class of n students print the total no. of female students and total no. of male students. At the end print the total no. of students in n class both males and females. In this problem, for loop is required.The greatest common divisor of two positive integers, A and B, is the largest number that can be evenly divided into both of them. Euclid's algorithm can be used to find the greatest common divisor (GCD) of two positive integers. You can use this algorithm in the following manner: 1. Compute the remainder of dividing the larger number by the smaller number. 2. Replace the larger number with the smaller number and the smaller number with the remainder. 3. Repeat this process until the smaller number is zero. The larger number at this point is the GCD of A and B. Write a program that lets the user enter two integers and then prints each step in the process of using the Euclidean algorithm to find their GCD. An example of the program input and output is shown below: Enter the smaller number: 5 Enter the larger number: 15 The greatest common divisor is 5Max Jones belongs to a CD (compact disc) club that allows him to buy CDs at a much lower price than his local music store charges. He wants to know how much he saves by buying all of his CDs through the club rather than through the music store. The output is the savings. The input is the number of CDs purchased, the club CD price, and thestore CD price. The algorithm should use two processing items: one for the cost of buying the CDs through the club, and the other for the cost of buying the CDs through the store. Write the algorithm using pseudocode.
- Q3: Interplanetary Spaceflight Milan Tusk is the richest person in the universe. After devoting decades of his life to further our space exploration technologies, he’s finally ready to retire. Being a space enthusiast, the first thing he wants to do is visit n planets p1, p2, …, pn, in this order. He’s currently on planet p0. Milan knows that the distance between planets pi and pi + 1 (for 0 ≤ i < n) is d[i]light years. His spaceship uses 1 tonne of fossil fuels per light year. He starts with a full tank and can fill up his tank at any of the n planets (but he must not run out in between two planets). There’s a huge cost to set up the spaceship for refuelling. Due to financial constraints (he’s not THAT rich), he can fill up his tank at most ktimes. In order to save money and make his spaceship lighter, Milan is looking for the smallest possible fuel tank that enables him to complete his space travel and reach planet pn. What is the smallest tank capacity that enables him to do so?…Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. Ex: If the input is: 90 the output is: I-90 is primary, going east/west. Ex: If the input is: 290 the output is: I-290 is auxiliary, serving I-90, going east/west. Ex: If the input is: 0 or any number not between 1 and 999, the output is: 0 is not a valid interstate highway number. This is the code I am using, but something is not functioning properly. import java.util.Scanner; public class LabProgram{public static void main(String[] args) {Scanner scnr = new Scanner(System.in);int…Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. use python
- Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. Ex: If the input is: 90 the output is: I-90 is primary, going east/west. Ex: If the input is: 290 the output is: I-290 is auxiliary, serving I-90, going east/west. Ex: If the input is: 0 the output is: 0 is not a valid interstate highway number. Ex: If the input is: 200 the output is: 200 is not a valid interstate highway number. highway_number = int(input()) ''' Type your code here. '''Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. Use java language.
- Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. Ex: If the input is: 90 the output is: I-90 is primary, going east/west. Ex: If the input is: 290 the output is: I-290 is auxiliary, serving I-90, going east/west. Ex: If the input is: 0 or any number not between 1 and 999, the output is: 0 is not a valid interstate highway number. This is the code I have but for some reason I keep getting errors. what am doing wrong? import java.util.Scanner; public class LabProgram {public static void main(String[] args) {Scanner scnr = new…Who are the oldest members of our class? students in CSE are. You get two lists of random lengths, one with the ages of CSE G1 and one with the ages of CSE G2 on two seperate lines. Find out who the three oldest students are in descending order. Input Format The first line of input will contain the ages of the students in CSE G1 The second line of input will contain the ages of the students in CSE G2 The ages will not be less than 0 and more than 100, and the number of students varies for each case Output Format The ages of the three oldest students in CSE, seperated by a space in descending order Sample Testcase #0 Testcase Input 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 30, 31, 32, 33, 34, 35, З6, 37, 38, 39 Testcase Output 39 38 37le.com/forms/d/e/1FAlpQLSc6PlhZGOLJ4LOHo5cCGEf9HDChfQ-tT1bES-BKgkKu44eEnw/formResponse The following iterative sequence is defined for the set of positive integers: Sn/2 3n +1 ifn is odd if n is even Un = Using the rule above and starting with 13, we generate the following sequence: 13 u13 = 40 u40 =20 u20 = 10→ u10 =5 u5 = 16 u16 = 8 ug = 4 → Us =2 u2 =1. It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. The below function takes as input an integer n and returns the number of terms generated by the sequence starting at n. function i-Seq (n) u=n; i=%3; while u =1 if statement 1 u=u/2; else statement 2 end i=i+1; end statement 1 and statement 2 should be replaced by: None of the choices statement 1 is "mod(u,2)=D%3D0" and statement 2 is "u = 3*u+1;" statement 1 is "u%2" and statement 2 is "u = 3*u+1;" O statement 1 is "mod(n,2)=30" and statement 2 is "u = 3*n+1;"