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

Question

2. Write a program called ListOddNumbers that prints the below (there is a single space between each number). 

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

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Write a program that coverts a zip code to a bar code. The bar codes use large and small bars. We wi...

A: Since no programming language is mentioned we will use Java to implement solution to this problem. F...

Q: Give regular expressions for the following languages. (a) L1 = {anbm, n ≥ 3, m ≤ 4} (b) L2 = {anbm :...

A: Answer:Regular expression:a. L = {an bm, n >=3, m <= 4}

Q: Attached Files:  getRandomLib.h: // This library provides a few helpful functions to return rand...

A: Program Instructions:Include the necessary header files.Print hello message and as for a response.De...

Q: Nine coins are placed in a 3x3 matrix with some face up and some face down. You can represent the st...

A: As there is no programming language mentioned, we are writing this program in JAVA. The program is g...

Q: Hello, I have a question with the program javascript and in the program I need to create a timer in ...

A: To display the greeting message, we can declare a new variable, suppose wish, to store the greeting ...

Q: function myCompose(f,g){// TODO: return (f o g);// that is, a function that returns f(g(x)) wh...

A: Click to see the answer

Q: Show that the following grammar is ambiguous: S→AB|aaaB,A→a|Aa,B→b.

A: A grammar is known as ambiguous when there is more than one derivation tree (right most derivation t...

Q: I have a question about blockchain technologies. The question states "Describe three components of b...

A: Solution:Blockchain technologies:Blockchain is a technology which permits the digital data to be dis...

Q: the book is "First Course on Fuzzy Theory and Applications"

A: The formula for calculating the Hamming distance (d) of fuzzy set:

Q: In Eclipse write a while loop which prints the even numbers from 20 to 30 (including 30).

A: Program Instructions:Create a class named PrintEven, and initialize a variable i to 20 in the main m...

Q: 6. Write a class with a constructor that accepts a String object as its argument. The class should h...

A: Two java.util classes are used – Scanner and Arrays. Scanner is used to read input string and Arrays...

Q: what is the best test strategy for any ERP system?

A: ERP stands for Enterprise resource planning is a software used for business process management. It a...

Q: Programming in C language.

A: Note:The below given program has been compiled using "repl.it" online compiler.

Q: Write a class in java with the name AgeMessages , which does the following:a. Ask the user to enter...

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...

Q: The following print code is to find out the ASCII code, character for the decimal codes,and comparis...

A: ASCII chart is shown on the board

Q: Write a function for the Superman ride at Six Flags that determines whether the user is taller than ...

A: Program code to write a function for the Superman ride  to determines whether the user is taller tha...

Q: use java Develop a program which allows the user to enter numbers into an array. Input will be as fo...

A: To develop this program  ,first of all you import  java.util.Scanner package in  which Scanner class...

Q: how to to assign charather to perform additions (+), subtractions (-), multiplications (*), division...

A: Program plan:Include necessary header files.Declare the “namespace”.Define the “main()” function.Dec...

Q: How do I define a recursive function with C++? I am supposed to compute the Fibonacci numbers with a...

A: The algorithm for the recursive Fibonacci series is as below:Start with the first element which is 0...

Q: Find dfa’s that accept the following languages: (a) L (aa∗ + aba∗b∗). (b) L (ab (a + ab)∗ (a + aa)).

A: We will solve part (a) L (aa∗ + aba∗b∗) first. To get the DFA, we need to draw the NFA of the given ...

Q: Develop pseudocode for the problem of reading in an arbitrary number of DNA (deoxyribonucleic acid) ...

A: PseudocodeCreate a dictionary data structure to store the DNA base and the complementary base as ser...

Q: Programming in C.

A: Note: The below program has been complied and executed in "repl.it" online complier

Q: how to put a picture to top right corner in HTML

A: HTML stands for Hypertext markup language and is mainly used to format web pages and web sites. Html...

Q: For problem 10RQ for Business Informaiton Systems book by Paige Baltzan, the question asked what is ...

A: The terms Collective intelligence, Knowledge management and Crowdsourcing are related to each other ...

Q: For the following problem please write an algorithm in plain English .i.e give details as to how you...

A: Algorithm to arrange the deck of 52 cards for the given scenario is as follows:  

Q: This code is for python

A: This is a very long problem because of lack of space we provide only a portion of the algorithm. How...

Q: Example Execution Trace You must exactly match the below layout. Melcome to a fun word replacement g...

A: Create a java class named FunWordGame as shown below:-public class FunWordGame {}

Q: Write a program that contains 2 methods, main and printLine (10 points)1) The printLine method will ...

A: Declare required variables ‘first’, ‘second’ and ‘times’ which is used to store first character, sec...

Q: When disposing disks or hard drives, it is recommended to format them (writing binary zeros) at leas...

A: Reason of formatting the disks or hard drives is as follows:

Q: Write a complete C++ program that randomly generates 20 integers between the rangeof 1 to 50 and sto...

A: The random number is generated by using rand() function from stdlib.h and in order to generate a new...

Q: Create a trigger called Trig_Enroll_BI on the ENROLLMENT table that fires before an INSERT statement...

A: Solution:Create the trigger with name of “Trig_Enroll_BI” for ENROLLMENT table.The followings algori...

Q: Is each of the following an absolute pathname, a relative pathname or a simple file name?a. Milk_cob...

A: Absolute path specifies the location of a directory or file from the root directory including a slas...

Q: Consider the following procedure: procedure mystery (x, y, z); integer x, y, z;beginz = 2; y= z+x;en...

A: Pass by reference copies the location of argument to the parameter. Hence, the final value of n, A[1...

Q: 5-18) (Display four patterns using loops) Ask the user to enter an integer toset a limit for nested ...

A: The algorithm would run into 4 sections for each pattern. For patterns A and C each line will have i...

Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb....

A: //Import required packagesimport java.util.Scanner; //Definition of class "AgeMessage"public class A...

Q: Write a program in c++ to generate a random number between 1 - 100, and then display which quartile ...

A: Program plan:Include the required header files into the program.Define the main function.Declare the...

Q: Create a list of 3 technologies that have gone from analog to digital. What was the reasoning for e...

A: Back in 1970s and earlier main technology in use was analog technology. Analog technology used vario...

Q: What is the output of the following code: public class A{public int methodOfA(int i){i += 10;return ...

A: Given program:File name: A.java

Q: SQL (Oracle) How do I create a unique constraint to find a specific price range? i.e. between 30 - 1...

A: Query to create tabale:Let us assume the table name as "Product". CREATE TABLE PRODUCT(ORDER_ID INT,...

Q: make the Matlab code for the given question no 5 and 6

A: Note: This program is compilde and executed in MATLAB/OctaveThe program has the following algorithm:...

Q: Use eclipse for these methods

A: Solution:Given data,The java code to display the output for method calls using the method overloadin...

Q: What’s the difference between integer, Floating point, and integer variable length? And how do I cal...

A: Assuming you are working in C language the explanation for the two data types integer and floating p...

Q: use java Develop a program which allows the user to enter numbers into an array. Input will be as fo...

A: Program plan:Import the required packages.Define a class named “ArraySort”.Define a “main()” method....

Q: Write a program called LoopMinMax that reads in 4 values from the user and prints the lowest and hig...

A: You didn’t mention which language should be used for the given program. Here, I have used JAVA langu...

Q: in eclipse

A: In operator overloading, the type of arguments defines which function will be called at the run-time...

Q: How to use ProstgreSQL in my local Java IDE using SSH tunnelingon a Mac using intellj Idea , eclipse...

A: Lets first check about Intellij:1) Open the Database tool window (View | Tool Windows | Database) an...

Q: Task_1: Base-10 conversion of the following Base-2 values? 101101   2. 011101   3. 1001   4. 11111...

A: Conversion of Base-2 to Base-10: 1. 101101:

Q: Complete the following programming assignment. Use good programming style and all the concepts previ...

A: Program Instructions:Create four methods named insertionSort(), bubblesort(), mergesort() and quicks...

Q: In Example 6.1, show a derivation tree for the string ababbac, using both the original and the modif...

A: Given:Grammar 1: A→a|aaA|abBc,B→abbA|bModified grammar: A→a|aaA|ababbAc|abbc,B→abbA|bString: ababbac

Q: 3. Which command can you use to look for the file names status.report? Which command can you use to ...

A: The command used to look for files is ‘find’ command. Find command can be used with many criteria to...