. What will get printed as output? a = [ 10, 20, 30, 40, 50 ] a.remove(30) print(a)
Q: What will the following code output? int *MyPtr, MyNums[ ]= {-1, 0, 3, 4): MyPtr = MyNums; cout<<…
A: Given:
Q: 19. What will the following code print out: if x < 2 : print ('Small) elif x < 1 : print ('Medium)…
A: ANSWER:-
Q: What is the output of the following code? int[] a = {10, -28, 33, 28, -49, 56, 49}; Arrays.stream(a)…
A: Given that int[] a = {10, -28, 33, 28, -49, 56,…
Q: Given the following arrays: String days[]={"Monday","Tuesday","Wednesday","Thursday","Friday"};…
A: According to the Question below the solution: Output:
Q: 1. Write a program that will find the Smallest, Largest and Average value in a collection of N…
A: As no language is mentioned I am solving this using C. #include <stdio.h>int main(){ int…
Q: How many times does the following code execute? err=l; count=0; while err>0.25 count=count+1; end…
A: A) Infinetely many
Q: "<« z <<endl; %3D <« y<< %3D cout<<x<<" return e; } void calc(int a, int &b){ int c; c=a+1; a=a*2;…
A: Explanation In this Program, we have used both call by value and call by reference. while passing x…
Q: Assume that the value of p is 0x7ffc0804. What will be the value of p+3? int values[5]; int* p…
A: Please find both solutions in the below steps.
Q: Please solve this using java Write an application that allows a user to enter the names and birth…
A: According to question: We have to write code for an application that allows a user to enter the…
Q: fix code below make it run correctly import random mylist =…
A: Answer in step2
Q: void mysteryFunction(int myList[][5], int r, int c) { int i, j, k, curr, temp; for ( (1) ) for (i =…
A: In the main method, we have a 2dimensional array with 2 rows and 5 columns. Next, we have called the…
Q: In Java Write a program which should be able to store 2 quiz scores for a maximum of 5 students.…
A: The program includes a Scanner class present in the io package. Scanner class is required for taking…
Q: Q1) (40 points) Write a method that generates and outputs a random permutation of numbers between 1…
A: Code
Q: Complete the following code so that the output will be : [6, 2, 3, 4, 5, 1] lst = [1, 2, 3, 4, 5]…
A: In the late 1980s, Guido van Rossum started working on Python as a replacement for the ABC…
Q: In the composer array, create a statement that copies the string "Beethoven."
A: STATEMENT: This statement copies the string Beethoven into the composer array. stripy is the…
Q: in java when you use an enhanced for loop with an array, you don’t need to use a/an ________________…
A: If arr is an array of integers, then we can print the entire array using enhanced for loop as…
Q: USE JAVA Write an application that allows a user to enter the names and birthdates of up to 10…
A: Given: USE JAVA Write an application that allows a user to enter the names and birthdates of up to…
Q: Write a program that will help a Little League coach keep track of the players on the team. Use an…
A: Use an infinite loop to display various options and specify a condition to quit from loop when user…
Q: *in java* Array testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the…
A: step1) assign sumExtra to 0 step2) Iterate over testGrades array step3) if current element is…
Q: How many times will the following nested loop run? * int j=3; While(j>3) { for(int i=1;i<5;i++) j++;…
A: This question comes from Programming Language which is a paper of computer science. Let's discuss it…
Q: Write a program called StudentTable that prints the below table. Use only print() or printf(). DO…
A: Code: #include<stdio.h>int main() { char h[4][50]={"Name","Lab","Bonus","Total"}; char…
Q: What would be the result of the following set of code? int count = 1; while (count <= 10) {…
A: The given Code is 1. int count = 1;2. while (count <= 10)3. {4. cout…
Q: { int count = 1; do { cout << ( count % 2 ?"* ++ count ; } while ( count <= 6 ); } ++++ ") << endl;
A: Algorithm in following steps- Start Declare a variable count and assign count =1; Start a do- while…
Q: What will the following code display?var = '$'print(var.upper())
A: var = '$'print(var.upper()) The output of the above program is as follows:
Q: yee number, last name, first name, middle name, rate trans.csv - employee number, in, ou
A: The two csv files from which data has to be read and worked upon are employee.csv and trans.csv.…
Q: #include using namespace std; void insertElement(int* LA, int ITEM, int N, int K) { int J=N;…
A: Step 1:- Program Explanation:- 1.In this program, we insert element 6 at the index of 3 in the array…
Q: ODE SHOULD BE IN JAVA WITH ARRAYS AND LOOPS AND STUFFS!! Write an application that allows a user to…
A: Write an application that allows a user to enter the names and birthdates of up to 10 friends.…
Q: uestion B: ) Write a Java named CountMax that creates an array of 50 random program
A: Q
Q: (1) Create an array of String objects and populate it with the days of the week (7 days)(i.e.,…
A: Program code: //import the required packages import java.util.Scanner; //define the class Cafeteria…
Q: can you please write in java.util.scanner form and can you make it so i can copy and past it please…
A: Solution:-- 1)The given question has required for the solution to be provided in the form of the…
Q: void setLimits (int x, int y); int getNumber();
A: Answer is given below.
Q: 1-Write a method that returns m(i) for a given i values 2 + m(i) 2-Write a test program that reads a…
A: C++ is an object oriented programming language which gives a clear structure to program and allows…
Q: What is the output of the following?
A: Before going to the solution I want to explain the forEach loop. For each entry in an array,…
Q: What will be the value of variable k after execution of the following code? int n[10] = { 32, 27,…
A: Given:
Q: Python Coding-(On Pycharm Community Edition) Create a mini-lottery with TEXT ticket. The user…
A: Program Instruction:First import the module of the random numbers.Then read the file ‘ticket.txt’…
Q: lef foo (a : Int) { ... var b = a + 3 ... def bar(g : Int) { val h = b + g ... } def jat(...) {…
A: In the function foo, every time in the while foo is called with the value 3 because Val is passed…
Q: Java program Part B: For Loop Program Write a program to compute the sum of the first N Fibonacci…
A: The java code along with the screenshot of code and output are given below.
Q: Java Write an application that allows a user to enter the names and birthdates of up to 10 friends.…
A: Write an application that allows a user to enter the names and birthdates of up to 10 friends.…
Q: How many times will the print statement will be executed? int mycount-0; int p-30; while(mycount<p)…
A: b)3
Q: (Sum ArrayList) Write the following method that returns the sum of all numbers in an ArrayList:…
A: The given method prototype is below: public static double sum(ArrayList<Double> list) The…
Q: The following definition has errors. Locate as many as you can. A) int size; double…
A: Answer: A.) variable size needed to be assigned a value.
Q: Q8. What is the output of the following code? def main(): my_list = [[1, 2], [[3], 4], 5]…
A: The given code contains 3-D array list. Answer is 3. As list[0] - it represents first element of the…
Q: #include int *get( ) int y = 10; int *x = malloc ( return y;
A:
Q: The following code should print out a random number between 1 and 10, why will it not function…
A: first lets understand : randint method: randint method takes two integer values for range as…
Q: What will be the output on screen after the following code is executed? int limit = 2, count=0;…
A: Given: A Java code having String str="H". Using a do-while loop some operation is done on the…
Q: int a=9, b=10; cout<<(a++) +(b--); getch(); return 0;
A: NOTE: There were some issues in your code which have been removed to get the answer. Getch() is used…
Q: 2. What will get printed as output? a = [ 10, 20, 30, 40, 50] a.remove() print(a)
A: Please find the answer below :
Step by step
Solved in 2 steps
- Please write a loop that prints multiples of 3 from 300 down to 3. This will be a java programming line.1. Write a java program that asks the user for a positive nonzero integer value. The program should use a loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1, 2, 3, 4, . . . 50. Filename: SumLoop.javaComplete the following code so that the output will be : [6, 2, 3, 4, 5, 1] lst = [1, 2, 3, 4, 5] lst.insert(1,Blank 1) del lstBlank 2 lst.append(Blank 3)
- Output below. You have to codeJava program Part B: For Loop Program Write a program to compute the sum of the first N Fibonacci numbers, where N is an integer that is input by the user. Once it computes the sum, the program will prompt the user for a new value of N. The program will exit if the user enters a non-integer number or string (such as “quit”) instead of an integer. For both the above problems, the first four numbers of the Fibonacci sequence are 0, 1, 1, and 2. Part B must use at least one For loop, but may also use while loops. Invalid (negative) numbers should be flagged and handled. Output should be like : Welcome to the Fibonacci AdderTo quit, end a non-integer number or string How many Fibonacci numbers should be summed? >> 10The sum of the first 10 Fibonacci numbers is: 88 How many Fibonacci numbers should be summed? >> xxx Thank You for Using the Fibonacci AdderUse a for loop to modify each element of arrfile4 by 2Use a for loop to modify each element of arrfile4a by 3 write the new contents of arrfile4 to file4by2write the new contents of arrfile4a to file4aby3 CODE: import java.util.*; import java.io.*; public class Pwriter2 { public static void main(String[] args) throws IOException { PrintWriter tofile2 = new PrintWriter ("file4.txt"); PrintWriter tofile2A = new PrintWriter ("file4a.txt"); int[] arrfile4=new int [10]; int[] arrfile4a=new int [10]; int i=0; while(i<10) { arrfile4[i]=i+1 ; tofile2.println(arrfile4[i] ); arrfile4a[i]=i+11; tofile2A.println(arrfile4a[i]); i=i+1; } tofile2.close(); tofile2A.close(); } }
- PYTHON ONLYPlease finish off this movie collection progam/code a) define print_longest_moviesTo complete the interactive loop, you must instantiate a Movie object using the information provided by the user and add it to the MovieCollection object using the provided add_movie method.b) complete the interactive loop This method is to take no arguments and print the title and duration of the top three longest movies in descending order (i.e. highest to lowest). Additionally, each movie should be numbered in the output (i.e. the longest movie is 1, the second longest is 2, etc). Here's an example of output which could be produced when print_longest_movies is called: 1. Titanic (194 minutes)2. Vertigo (128 minutes)3. Jaws (124 minutes) the code: class Movie:def __init__(self, title, duration):self.title = titleself.duration = durationdef get_movie_duration(movie):return movie.durationclass MovieCollection:def __init__(self):self.movies = []def add_movie(self,…Find the output #include<iostream.h> void main () { int a=3,b32,c%3Da*b; b++; a=b++; b++; cout<<a<<"\t"<<b<<"\t"<<c<<endl;}Python Coding-(On Pycharm Community Edition) Create a mini-lottery with TEXT ticket. The user is going to save three numbers in a text file - those three numbers are from 1-9. In Python, create a program that reads those three numbers from the text file (ticket) Use a random number generator to draw three random numbers Compare the text ticket and the random numbers. If they match number (see below), output the prize The numbers can be in any order the random numbers can be duplicates, so be careful how you count! This work in a similar way to mini-assignment number 48 - but you DO NOT have to write to a text file. Have the user enter the numbers into the text file. Append the numbers read from the text file to a list read each number from the list and compare it to the randomly generated numbers you come up with One number match - free ticket Two numbers match - $2.00 Three numbers match - $10.00 -you don't have to complete bonus, it would be great if you could-…
- CSC 220: Word Unscrambler Game Use Java programming. Design and implement a word unscrambler game in Java. Your program should read in a random word from a file called words.txt(note the lack of capitalization) that you provide.The words.txtfile will beplacedin the same folder with your Java program.The file should contain one word per line andcontain at least 10 different words. To read a random word you can generate a random number between 1 and the number of lines, and skip n-1 lines before reading the word. Scramble the word by swapping random pairs of letters a random number of times(mandatory use of a loop). Display the scrambled word with character indices on top. Offer the user a menu with the following choices: Enter 1 to swap a pair of letters: If this option is selected prompt the user to enter two indices and swapthe letters. A space should separate the two indices. Print an error message if the indices are invalid. If the word is unscrambled successfully print a…Java Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birthdate or "Sorry, no entry for name" if the name has not been previously entered. The loop continues until the user enters ZZZ for a name.PrimeAA.java Write a program that will tell a user if their number is prime or not. Your code will need to run in a loop (possibly many loops) so that the user can continue to check numbers. A prime is a number that is only divisible by itself and the number 1. This means your code should loop through each value between 1 and the number entered to see if it’s a divisor. If you only check for a small handful of numbers (such as 2, 3, and 5), you will lose most of the credit for this project. Include a try/catch to catch input mismatches and include a custom exception to catch negative values. If the user enters 0, the program should end. Not only will you tell the user if their number is prime or not, you must also print the divisors to the screen (if they exist) on the same line as shown below AND give a count of how many divisors there are. See examples below. Your program should run the test case exactly as it appears below, and should work on any other case in general. Output…