2. Write a program called ListOddNumbers that prints the below (there is a single space between each number). Printing odd numbers between 1 and 501 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 3. Write a program called NestedLoop that prints the below. Use a for nested loop. You need to use if nested loop. 122333444455555
Q: 1 22 333 4444 55555
A: This question comes from Programming Language which is a paper of Computer Science. Let's discuss it…
Q: You have a list of student ID’s followed by the course number (separated by a space) that the…
A: import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; public class Main{…
Q: What will the output be for the following nested for loop? for k <= 5 for m <= 10…
A: for k <= 5 for m <= 10 display (k * m) + “ “ next m next k
Q: Write a program called ListEvenNumbers wich prints the even numbers from 20 to 30 (including 30).…
A: As there is no programming language mentioned, we are doing this program in java to print even…
Q: Q7: Write a program that reads a collection of car speeds as long as the speeds do not exceed 100…
A: Program Approach: Including necessary header files Using namespace for standard input output…
Q: Use the isPrime() method that you wrote in (a) above to write a short program segment that uses a…
A: STEP 1: START STEP 2: define a function isPrime(n) STEP 3: result = True STEP 4: if n < 2 then…
Q: in coral language Write a program that first gets a list of 5 integers from input. Then, get another…
A: Actually, program is a executable software that runs on a computer.
Q: in coral languge Write a program that first gets a list of 5 integers from input. Then, get another…
A: Actually, program is a executable program that runs on a computer.
Q: If you add up all the digits in 468, you get 4 + 6 + 8 = 18. The square and cube of 468 are 219024…
A: As the language is not mentioned, So here is the python program for the same.
Q: Write a program that uses a for loop to print a table of the square roots, squares, cubes, and cube…
A:
Q: Write a program that allows the user to enter a number between 1 and 1000. If the number is…
A: import math def isPrime(n): if (n <= 1): return False if (n <= 3): return…
Q: This is the question I am stuck on - Write an application that accepts up to 20 Strings, or fewer…
A: The, code has given below:
Q: Write a programs that will take 3 lists: Name Wage Hours Juan 7.50 35 Rae 11.00 41 Ivanna 18.25 26…
A: PROGRAM: #defining 3 lists name=["Juan","Rae","Ivanna","Lilly","Robert"]…
Q: Which one of the following data types can we NOT loop through? A) list B) string C) float D)…
A: A data type is an attribute of data which tells the compiler or interpreter how the programmer…
Q: I need to make a program that asks users to enter 5 words; and prints the list of palindrome and…
A: Required: I need to make a program that asks users to enter 5 words; and prints the list of…
Q: Task Write a program that can dynamically change the font of a text in a label displayed on a stack…
A: GIVEN: Write a program that dynamically changes the font of a text.
Q: Write a procedure called unique_letters(str) that takes as its input a string of any length. The…
A: Algorithm: Procedure: unique_letters(str) 1. Convert str into set named as Set. 2. Find length of…
Q: Ô https://learn.zybooks.com/zybook/SNHUIT140V3/chapter/6/section/3 ... = zyBooks My library > IT…
A: Algorithm: Start Read space separated integers in a list Iterate through the list from i=0 to…
Q: Write a for loop to print all elements in courseGrades, following each element with a space…
A: Problem Statement: We need to write a for loop to print all elements for each element with space.…
Q: Language: Python with Turtle Write a program that will have Turtle draw a row of 40 circles across…
A: Our task is to draw a 40 circles in a row using turtle. The circles should not overlap each other.…
Q: Write a for loop to print all elements in courseGrades, following each element with a space…
A: import Scanner class present in java.util package for take input in arrays. once final variable is…
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: Which of the below is a correct initializer list for an array of strings? Select one: a. String[]…
A: A String is a sequence of characters. Arrays are used to store multiple values of the same types in…
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: The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered.
A: Approach Two while loops are used. The first while loop stores the short strings in the first list…
Q: #include #include using namespace std; const int X1_INDEX= 1; const int X2_INDEX= 0; const int…
A: C++ program to find the square roots of quadratic equation :- #include <iostream>#include…
Q: Write a program that reads a list of integers from the keyboard and creates the following…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: What happens when you remove the entry from position 4 from a List? Select one: a. All of these b.…
A: when an entry at position 4 is removed from the list. entry 4 will be returned and the 5th entry…
Q: Write a programs that will take 3 lists: Name Wage Hours Juan 7.50 35 Rae 11.00 41 Ivanna 18.25 26…
A: Note: Below is the required program in python. Programming Approach: Defining 3 lists. Using for…
Q: program that asks users to enter 5 words; and prints the list of palindrome and not palindrome…
A: In case the reversal of a string is the same as the string, it is considered to be a palindrome. For…
Q: 42. Write a loop that will read in a list of even numbers (such as 2, 24, 8, 6) and compute the…
A: According to the Question below the Complete Program: Program Output:
Q: Write a program using nested for loop to print table of a range of numbers that user enters. Sample…
A: As no programming language is mentioned, so I am using Python. In step 2, you will the Python…
Q: Create a simple loop that prints instructor names, where instructor IDs are in the range from 101 to…
A: Since you have not mentioned the programming language. i will attempt this in python using…
Q: Here is the assignment Write a program that prints the multiplication table but inserts a randomly…
A: Program: #include <stdlib.h> #include <iostream>#include <iomanip>using namespace…
Q: Write a program called StudentTable that prints the below table. Use only print() or printf(). DO…
A: The program will used to print the student details in tabular form. Where we have name[] array which…
Q: Write a WHILE loop that will print out all of the non-overlapping blocks of three characters from…
A: Refer to step 2 for the answer.
Q: Write a program that uses a loop to ask the user to enter today’s sales for five stores. The entered…
A: program that uses a loop to ask the user to enter today’s sales for five stores: the program is…
Q: In python, write a code that allows the user to input two non-negative number sequences in…
A: The user input is taken firstly and the Enter key is pressing after inputting each element until the…
Q: Write a program that uses a loop to ask the user to enter today’s sales for five stores. The entered…
A: sales_list = [] for i in range(0, 5): print("Enter today's sales for store {}: ".format(i+1),…
Q: Write a for loop to print all elements in courseGrades, following each element with a space…
A: import java.util.Scanner; public class CourseGradePrinter { public static void main(String[]…
Q: se try and except . Create a program that uses a loop to provide a k ? k times table similar to the…
A: Input : Input k value Output : Output the table
Q: b. Write a loop that prints each number and its square on a new line. Print (X3, eN) c. Write a loop…
A: Loops are executed until the condition fails, here is a statements are there to write a loops. In…
Q: Write an application that allows a user to enter the names and birthdays of up to 10 friends.…
A: Syntax: while ( Condition ) { // Loop-body } Flowchart:
Q: Which statements are correct to combine the following two circular linked lists? Head1 P1 900 700 A…
A: Note: in the question, you are not given any statement so I will provide the following. If we want…
Q: Write a program that asks the user to enter 10 numbers, that range from 10-100. Make sure that you…
A: Solution: Given, Write a program that asks the user to enter 10 numbers, that range from 10-100.…
Q: Write a program that replaces the name of each month with its three-letter abbreviation. Save it as…
A: A required program is as follows, File name: "months.py" # a) Create a list months = ['january',…
Q: Write a program that keeps names and emails addresses in a dictionary as key-value pairs. First…
A: d = {'name': 'E-mail@gmail.com', 'Test Name': 'test@test.com', "rony": 'rony@gmail.com', 'john':…
2. Write a
Printing odd numbers between 1 and 50
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
3. Write a program called NestedLoop that prints the below. Use a for nested loop. You need to use if nested loop.
1
22
333
4444
55555
Trending now
This is a popular solution!
Step by step
Solved in 6 steps
- Write a program that uses a for loop to display a table that lists in one column values for ounces, followed by columns that show the equivalent in pints, quarts and litres: Enter a start value, an end value and a step value for a range of values for the ounces. • Use a for loop to do the following for the range values: • Show on each line of the table four columns starting with the ounces, followed by the pints, quarts and litres. The formulas for the units are: • pints: ounces * 0.0625 • quarts: ounces * 0.03125 • litres: ounces * 0.02957 • Show all values in the table with two decimal places each, and right-aligned so all the decimal places are lined up with one another. Use a while loop to show the table. • Show the table from a high value to a low value.(Use Dev C++) Write a program that reads a list of scores between 0 and 100 and finds and prints the smallest and the largest scores. The program needs to ask for the number of the scores from the user; thisnumber must be less than or equal to 10Write 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. import java.util.*; public class BirthdayReminder { public static void main(String[] args) { // Write your code here } }
- 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.This code gets an error for going out of range in the last for loop. What can I do to fix this? # Lucas Conklin# 5772707import csvimport statistics def readCSVIntoDictionary(f_name): data = [] with open(f_name) as f: reader = csv.reader(f) for row in reader: if not data: for index in range(len(row)): data.append([]) for index in range(len(row)): data[index].append(float(row[index])) f.close() return data features = readCSVIntoDictionary("C:\\Users\\lucas\\Downloads\\pima.csv")print(features) def find_median_and_SD(data, feature): med = statistics.median(data[feature]) rounded_med = round(med, 4) st_dev = statistics.stdev(data[feature]) rounded_st_dev = round(st_dev, 5) return rounded_med, rounded_st_dev for i in range(0, len(features)): (median, st_dev) = find_median_and_SD(features, i) print(f'Feature {i} Median: {median} Standard Deviation: {st_dev}')…Write a program that displays the pattern show in the* sample executable.** Type of loop-> your favorite (you must use a pair of* nested loops)* Hints:* 1) Use variables that increments* 2) When running the sample, use values between 61 and* 76 for the number of columns, values between 16 and* 21 the number of rows* 3) Start with a rectangular array of "X" then figure out* how to create one of the upward lines and then the* backwards lines and then both lines*
- Write a sub that requests a positive integer with an InputBox. Then use a For loop to sum up all the odd integers up to the input number [e.g. if the user enters 8, the program should add up 1, 3, 5, and 7 only]. Display the sum in a message box. Once you get this part working, delete the message box, and change the sub so that it enters all the odd numbers in consecutive cells in Column A of the worksheet, starting with cell A1, and displays the sum, boldfaced, just below the last odd integer. Hints Clear the contents of the worksheet to delete numbers from any previous run. To do this, use: Range(“A1”).EntireColumn.Clear Your For loop will need Step 2 so that it loops through 1, 3, 5, … etc. instead of the usual 1, 2, 3, … Clear out your accumulator (Total) at the beginning You would need an integer variable, say Row, to keep track of where you want to write the next number on the sheet. You can then write to the sheet by using:…In python The text file “studentMarks.txt” has been provided for you. Each line contains the Last Name, First Name and 8 marks separated by spaces of a single student. For each student in the file, adjust the file to include the average of their top 6 marks, rounded to 1 decimal place, at the end of the line. For example, in the file, the line may say: Mars, Bruno 82 82 85 94 65 79 81 90 Afterwards, it should be updated to say: Mars, Bruno 82 82 85 94 65 79 81 90 Top6Avg: 85.7 Your program must define a function to determine the average of the top 6 marks. You may define more functions as needed for your program.Rewrite the previous program by using for nested loop ? And the result must be as the following 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
- Write a program that creates the multi-panel plot shown below, for Planck curves at 4 different temperatures Planck Curves Use embedded noninteractive plotting and set the figure size to be 10x5 inches. • You may write your program in a single cell, or break it over multiple cells. Use a logarithmic x axes, and the logspace() function for generating the axes values. You will have to be careful with units on this one. For 50% extra credit have your program use a loop over the four axes, with all the plotting code contained within the loop (except for any subplot adjustments). 0.030 12 300K 1000K 0.025 10 0.020 FBBX (Wm-nm-1) FBBA (Wm-2nm-¹) 0.015 10 0.010 0.005 2 0.000 A (nm) λ (nm) 100000 3000 3000K 6000K 2500 80000 2000 60000 FBBA (Wm-2nm-¹) FBBX (Wm-2nm-1) 1500 40000 1000 20000 500 0 101 102 0 101 103 104 105 106 102 103 104 105 106 X (nm) λ (nm) python languageInitialize a variable for the row, and set it to zero. Then, create a for loop from 0 to the total number or rows, then within the for loop, create a conditional that says that if the first and second entry of the array at the index of that iteration number is equal to the longitude and latitude respectively, then the value of row equals the number of the iteration. How do I do the section in bold? Here is my code so far: public static int[] oneMonthGenerator(double longitute, double latitude, int month, double[][] drywet, double[][] wetwet) { for (int row = 0; row < 4001; row++) { if (longitute == drywet[row][0] && latitude == drywet[row][1]) { row = -----> ? } else if (longitute == wetwet[row][0] && latitude == drywet[row][1]) { row = -----> ? } }In Python, using a single loop, ask user to enter values to 3 different lists, the first one should containthe names of 3 people, the second one should contain the heights of 3 people, and the third oneshould contain the weights of 3 people. Use the zip function to zip all three lists at the sametime; print list