Fix the errors in the procedure below. def BMIImperial(height, weight, bmiList, Category): i=0 while(i
Q: Draw a standard trie for the following set of strings: { banana, banner, ban, banned, ban
A: standard trie
Q: IN C Language. THANKS... the string below comes from an alphabet consisting of only characters A…
A: I have provided solution in step2.
Q: Write a program that asks the user for strictly positive numbers and stores them in a list. The…
A: Please find the answer below :
Q: This exercise will enhance your understanding of classes and operator overloading. Using the…
A: The program is implemented in C++ with object oriented approach. For the sake of better…
Q: Fix the Java program: Make sure the program have the "Main" function. Code: class…
A: In the given code, the third line "publicstaticvoid Main(String[] args)" have the errors. The…
Q: ef loopy_madness(string1: str, string2: str) -> str: """ Given two strings and , return a…
A: According to the Question below the Solution: Output:
Q: Complete the code by filling in the blanks for A, B, and C.
A: numbers[i]= numbers[i]**2
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: Program instructions:Create a function ‘GetMinimumInt()’, which is going to find minimum element…
Q: Please answer it in Python Write a palindrome function that takes a word as an argument and returns…
A: #Palindrome function that takes a word as an argument and returns a#boolean indicating whether the…
Q: Try a spatula def pancake_scramble(text): Analogous to flipping a stack of pancakes by sticking a…
A: Algorithms Used:- Start:- 1)Create a function named as def pancake_scramble(text) where data type of…
Q: Question 2.1 Given a positive integer, N, the '3N+1' sequence starting from N is defined as follows:…
A: #include <iostream>using namespace std;int sequence(int N){ int x,count = 1;…
Q: Task 06: Use the recursive definition of Fibonacci series and write a function int fib(int n) that…
A: ALGORITHM:- 1. Take input for the value of n from the user. 2. Pass it to the fib() function. 3.…
Q: A contact list is a place where you can store a specific contact with other associated information…
A: The below given C++ program will obey the following rubrics:Importing essential header…
Q: Solve in Python: A contact list is a place where you can store a specific contact with other…
A: First, we will input the string. Then we will split the string and find the number of person…
Q: def sum_even(n): total = 0 for i in range(2, n+1, 2): total += i return total def min(t): m = 0 for…
A: Q: Code the given program to recursive functions
Q: def loopy_madness(string1: str, string2: str) -> str: Given two strings and , return a new string…
A: As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: In Java: Write a program that first gets a list of integers from input. The input begins with an…
A: Java code :- import java.util.*;public class MyClass { void getUserValues(int a[],int n,Scanner…
Q: def count_vowels(self, a_string): """ Given a string, count the number of vowels one character at a…
A: Please find the answer below:
Q: Consider again a list of hourly temperature readings from a fridge, in degrees Celsius, as described…
A: Algorithm: 1. Input List 2. Put index as 0. 3. Check length if index is less than list 4. increment…
Q: • Complete the examples in the docstring and then write the body of the following function: def…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: In the C programming language Suppose you are given an array of integers. You want to insert a…
A: #include<stdio.h>void rearrange(int *a, int n, int insert, int *b);void rearrange(int *a, int…
Q: A contact list is a place where you can store a specific contact with other associated information…
A: Pseudocode:- Declare the member function String GetPhoneNumber with a parameter of vector type to…
Q: Write a recursive method toNumber that forms the integer sum of all digit characters in a string.…
A: Recursion is a process in which a method calls itself continuously.
Q: (Java) Write a program that uses String method regionMatches to compare two strings input by the…
A: The method regionMatches() compares two Strings to see if they are equal. One can match the…
Q: randomizing the angle the turtle turns. Rather than always using a 30 degree angle, select an angle…
A: Required: randomizing the angle the turtle turns. Rather than always using a 30 degree angle,…
Q: Problem 4: Magic Square Test A magic square of order n is an arrangement of n × n numbers, usually…
A: Note: Programming language not mentioned in the question. C++ is chosen for implementation.…
Q: Add a print statement in the program below that prints all of the entries in the list at the end.
A: height and name are initially lists and they are updated as return values and this makes previous…
Q: Implement the following: 1) Store the following data into a tuple, colors: red, green, 2) Store the…
A: type() is a function in python used to print the type of a variable
Q: Convert the following for-loop into an equivalent while-loop as closely as possible using the code…
A: The code is given below.
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: Program: n = int(input()) # variable n indicates number of integers which will followlist = [] # an…
Q: The code is already given above. Problem: Using PYTHON, create and implement a recursive function…
A: Answer: I have done code in iterative as well as Recursive code and also i have attached code code…
Q: how to use compareTo method and how to use them in practical application. Please use simple terms.
A: Java: Java is a general purpose, high level, class based object oriented programming language. It…
Q: the infix expression a/b-c+d*e-a*c into postfix expression and trace that postfix expression for…
A: the infix expression a/b-c+d*e-a*c into postfix expression and trace that postfix expression for…
Q: Write in JAVA When analyzing data sets, such as data for human heights or for human weights, a…
A: History of Java Ames Gosling create Java at Sun Microsystems in the outset. It became a fundamental…
Q: Question 2.1 Given a positive integer, N, the "3N+1' sequence starting from N is defined as follows:…
A: The program is written in c++
Q: Write a recursive function to print all the permutations of a string. For example, for the string…
A:
Q: When analyzing data sets, such as data for human heights or for human weights, a common step is to…
A: import java.util.Scanner;public class LabProgram { public static void main(String[] args) {…
Q: Given a long string use recursion to traverse the string and replace every vowel (A,E,I,O,U) with an…
A: As no programming language is mentioned, we will be using JAVA The full working code is given in…
Q: A user is going to enter numbers one at a time, entering 'q' when finished. Put the numbers in a…
A: I give the code in Python along with output and code screenshot
Q: For this program, adjust the values by subtracting the smallest value from all the values. The input…
A: EXPLANATION - Create a program . Declare a variable num and take number of elements to be entered…
Q: A sequence of n>0 integers is called a jolly jumper if the absolute values of the differences…
A: Answer: Here not mention any specific language use so we have done code in C++ programming language…
Q: def reverse_sentence(s: str) -> str: """ This means that in the string 'ATest string!', there are…
A: First, we will create a function def reverse_sentence(s: str) -> str: This function will accept…
Q: In Python 3 You can create a more interesting and realistic-looking tree by…
A: randomizing the angle the turtle turns. Rather than always using a 30 degree angle,…
Q: The task is to get input (n) and make a list from 2 to n and remove its multiples from the list by…
A: Python code from math import sqrt def createList(n): return list(range(2,n+1)) def…
Q: public: const cAssignmentOprOverload& operator=(const cAssignmentOprOverload& otherList); //Overload…
A: c++ (the question in the photo,plz don't tell me that you are not able to solve it, take your time…
Q: Write an algorithm for a program that determines all composite numbers between 1 and 20
A: In order to find all the composites between 1 and 20, the following steps are performed : Using…
Q: Draw the call stack if the recursive method in the previous step is called like this:
A: I have answered this question in step 2.
Q: Solve all the errors in the below method of C# language step by step and comment the error by…
A: After removing all the errors the correct code is given below with proper comments as below:
Q: >>>myList = [1024, 3, True, 6.5] >>>myList.append(False) >>>print(myList) >>>myList.insert(2,4.5)…
A: myList = [1024, 3, True, 6.5]#list containing some value myList.append(False)#the append function…
Q: The function 'CountWords' is given below to find the number of words in a sentence. Which of the…
A: The complete function definition of CountWords is as follows: int CountWords(char *P){ int count…
Fix the errors in the procedure below.
def BMIImperial(height, weight, bmiList, Category):
i=0
while(i<len(height)):
BMI = (weight[i] * 703) / (height[i] * height[i])
print ("Your BMI is " + str(BMI))
if (BMI <= bmiList[0]):
print('you are:', Category[0])
elif (BMI <= bmiList[1]):
print('you are:', Category[1])
elif (BMI <= bmiList[2]):
print('you are:', Category[2])
else:
print('you are:', Category[3])
i=i+1;
Step by step
Solved in 3 steps with 3 images
- do the changes in this program according to the given instruction import java.util.*;class CourseManager{//toatl students each section can holdstatic int max_Students;//mapping of each sections w.r.t to courseHashMap<String,ArrayList<Section> > courses ; //constructor for CourseManagerpublic CourseManager(int max){max_Students = max;courses = new HashMap<>();}//class Person which will be used by teacher and students to inherit its propertiesstatic class Person{String name;int age;public Person(String name , int age ){this.name = name;this.age = age;}}//teacher classstatic class Teacher extends Person{int id;public Teacher(int id , String name , int age ){super(name , age );this.id = id;}}//student classstatic class Student extends Person{int id;public Student(int id , String name , int age ){super(name , age );this.id = id;}}//section classstatic class Section{int section;String course ;Teacher instructor;int size ;HashMap<Integer ,Student >…For any element in keysList with a value smaller than 50, print the corresponding value in itemsList, followed by a space. Ex: If the input is: 32 105 101 35 10 20 30 40 the output is: 10 40 import java.util.Scanner; public class Compare { public static void main(String args[]) { final int SIZE_LIST = 4; int[] keysList = new int[SIZE_LIST]; int[] itemsList = new int[SIZE_LIST]; int i; Scanner input = new Scanner(System.in); keysList[0] = input.nextInt(); keysList[1] = input.nextInt(); keysList[2] = input.nextInt(); keysList[3] = input.nextInt(); itemsList[0] = input.nextInt(); itemsList[1] = input.nextInt(); itemsList[2] = input.nextInt(); itemsList[3] = input.nextInt(); //answer// System.out.println(); } }For any element in keysList with a value greater than 40, print the corresponding value in itemsList, followed by a semicolon (no spaces). Ex: If the input is: 32 105 101 35 10 20 30 40 the output is: 20;30; import java.util.Scanner; public class Compare { public static void main(String args[]) {final int SIZE_LIST = 4;int[] keysList = new int[SIZE_LIST];int[] itemsList = new int[SIZE_LIST];int i;Scanner input = new Scanner(System.in); keysList[0] = input.nextInt();keysList[1] = input.nextInt();keysList[2] = input.nextInt();keysList[3] = input.nextInt(); itemsList[0] = input.nextInt();itemsList[1] = input.nextInt();itemsList[2] = input.nextInt();itemsList[3] = input.nextInt(); /* Your code goes here */ System.out.println();} }
- Perform the following. 1) Conver the infix expression a/b-c+d*e-a*c into postfix expression and trace that postfix expression for given data a=6, b=3, c=1, d=2 , e=4 .2) A student is asked to develop an application as part of mini project which reverses the order of numbers, such that the number that is placed last in the list will be removed first. The list can hold any number of elements. Implement the following menu based C++program for the same.C++ Create a Blackjack (21) game. Your version of the game will imagine only a SINGLE suit of cards, so 13 unique cards, {2,3,4,5,6,7,8,9,10,J,Q,K,A}. Upon starting, you will be given two cards from the set, non-repeating. Your program MUST then tell you the odds of receiving a beneficial card (that would put your value at 21 or less), and the odds of receiving a detrimental card (that would put your value over 21). Recall that the J, Q, and K cards are worth ‘10’ points, the A card can be worth either ‘1’ or ‘11’ points, and the other cards are worth their numerical values. FOR YOUR ASSIGNMENT: Provide two screenshots, one in which the game suggests it’s a good idea to get an extra card and the result, and one in which the game suggests it’s a bad idea to get an extra card, and the result of taking that extra card.Complete this code in Java import java.util.Scanner; import java.util.ArrayList; public class SET { ArrayListlist; int length; public SET(); { list=new ArrayList<>(10); length=0; } public SET(int cap) { list=new arrayList<>(cap); length=0; } public int getLength() { return length; } } public class SetApplication { public static void main(String[] args) { SET st=new SET(); System.out.println(st.getLength()); } }
- Using java, answer the following questions about the code below. 1) Create a new function or method that checks to see if an int parameter is present in the list. 2) Create a main() method or JUnit tests to show that your list code functions as intended. (Code) private class Nodeint data;Node next;Node(int data) {this.data = data;this.next = null;}}private Node first;private Node last; public void addToEnd(int data){ Node newNode = new Node(data);if (first == null){first = newNode;last = newNode;} else {last.next = newNode;last = newNode;}}public void printList(){ Node current = first;while (current != null){System.out.print(current.data + " ");current = current.next;}System.out.println();}public static void main(String[] args){node list = new node();list.addToEnd(2);list.addToEnd(4);list.addToEnd(6);list.printList();}}Write a program that lists all Fibonacci numbers that are less than or equal to the number k (k≥2) entered by the user. Definition:The Fibonacci sequence is a sequence of numbers in which each additional term is the sum of the previous two. It is based on the fact that each member of the sequence is formed by the sum of the previous two members, the sequence starting with the numbers 1 and 1. (Example 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 , 377, 610, 987 write program in c languageThis is needed in Java Given that an ArrayList of Strings named nameList has already been created and names have already been inserted, write the statement necessary to delete the name at index 15.
- The __str__ method of the Bank class (in bank.py) returns a string containing the accounts in random order. Design and implement a change that causes the accounts to be placed in the string in ascending order of name. Implement the __str__ method of the bank class so that it sorts the account values before printing them to the console. In order to sort the account values you will need to define the __eq__ and __lt__ methods in the SavingsAccount class (in savingsaccount.py). The __eq__ method should return True if the account names are equal during a comparison, False otherwise. The __lt__ method should return True if the name of one account is less than the name of another, False otherwise. The program should output in the following format: Test for createBank: Name: Jack PIN: 1001 Balance: 653.0 Name: Mark PIN: 1000 Balance: 377.0 ... ... ... Name: Name7 PIN: 1006 Balance: 100.0 bank.py """ File: bank.py Project 9.3 The str for Bank returns a string of accounts sorted by name.…The __str__ method of the Bank class (in bank.py) returns a string containing the accounts in random order. Design and implement a change that causes the accounts to be placed in the string in ascending order of name. Implement the __str__ method of the bank class so that it sorts the account values before printing them to the console. In order to sort the account values you will need to define the __eq__ and __lt__ methods in the SavingsAccount class (in savingsaccount.py). The __eq__ method should return True if the account names are equal during a comparison, False otherwise. The __lt__ method should return True if the name of one account is less than the name of another, False otherwise.Fix the code below so that there is a function that calculate the height of the triangle. package recursion; import javax.swing.*;import java.awt.*; /** * Draw a Sierpinski Triangle of a given order on a JPanel. * * */public class SierpinskiPanel extends JPanel { private static final int WIDTH = 810; private static final int HEIGHT = 830; private int order; /** * Construct a new SierpinskiPanel. */ public SierpinskiPanel(int order) { this.order = order; this.setMinimumSize(new Dimension(WIDTH, HEIGHT)); this.setMaximumSize(new Dimension(WIDTH, HEIGHT)); this.setPreferredSize(new Dimension(WIDTH, HEIGHT)); } public static double height(double size) { double h = (size * Math.sqrt(3)) / 2.0; return h; } /** * Draw an inverted triangle at the specified location on this JPanel. * * @param x the x coordinate of the upper left corner of the triangle * @param y the y…