Write a program that uses while loops to perform the following steps:
a. Prompt the user to input two positive integers. Variables: firstNum and secondNum
(firstNum must be less than secondNum) (use while loop); create a user-defined function
called validateUserInput() to validate the user's input. Use Call-by-Value.
validateUserInput() is a value returning function.

b. Output all odd numbers between firstNum and secondNum. (use while loop); create a
user-defined function called oddNumbers(). Use Call-by-Value. oddNumbers() is a void
function.

c. Output the sum of all even numbers between firstNum and secondNum. (use while
loop); create a user-defined function called sumEvenNumbers(). Use Call-by-Value.
Declare a variable called sumEven in the main() for the sumEvenNumbers().
sumEvenNumbers() is a valuereturning function. Use sumEven to hold a returned value.

d. Output the numbers and their squares between 1 and 10. (use while loop): create a
user-defined function called displaySquareNumbers(). Call-by-Value.
displaySquareNumbers() is a void function.

e. Output the sum of the square of the odd numbers between firstNum and secondNum.
(use while loop); create a user-defined function called sumSqureOddNumbers(). Use
Call-by-Value. Declare a variable called sumSquareOdd in the main(), for the

sumSqureOddNumbers(). sumSqureOddNumbers() is a value returning function. Use
sumSquareOdd to hold a returned value.

f. Output all uppercase letters. (use while loop); create a user-defined function called
displayUppercaseLetters(). Use Call-by-Value. displayUppercaseLetters() is a void
function.

Answers

Answer 1

The program is an illustration of the loop and functions

Loops are used to perform repetitive operationsFunctions are named code segments that ar executed when called or evoked

The main program

The program written in Python, where comments are used to explain each action is as follows:

#This function validates the user input

def validateUserInput(firstNum, secondNum):

   if firstNum >= secondNum:

       return False

   return True

See attachment for the complete program

Read more about loops at:

https://brainly.com/question/19347842


Related Questions

[ASAP] Choose the tool that best matches each description.

___ is an open-source library that can be used to develop mobile apps in Python, where all of the objects look the same, no matter what platform it is displayed on. In contrast, the ___ library uses native objects, so that applications built with it will look like other apps on that platform.

1. Kivy
2. BeeWare​

Answers

BeeWare​  is an open-source library that can be used to develop mobile apps in Python, where all of the objects look the same, no matter what platform it is displayed on.

What is BeeWare used for?

Others re:

In contrast, the Kivy library uses native objects, so that applications built with it will look like other apps on that platform.

The BeeWare framework is known to be a kind of open-source network that is known to be a reliable Python program that helps  developer with some amount of tools that are used  for coding.

Based on the above,  BeeWare​  is an open-source library that can be used to develop mobile apps in Python, where all of the objects look the same, no matter what platform it is displayed on.

Learn more about library from

https://brainly.com/question/1348481

#SPJ1

Name the test statement that can be used to test the following scenario:
The contents of the variable $TEST are equal to the string “success,” or the number 5, or the contents of the variable $RESULT.

Answers

The test statement is an illustration of conditional statements and logical operators.

The test statement is: if [[ "$TEST" == ”success” || "$TEST" == ”5” || "$TEST" == “$RESULT” ]]

How to name the test statement?

From the question, we have the following scenarios:

Determine if $TEST equals "success"Or $TEST equals "5"Or $TEST equals $RESULT

To do this, we make use of the if conditional statement and the or logical operator.

The or operator is represented with ||

Since the programming language is in php, the test statement is: if [[ "$TEST" == ”success” || "$TEST" == ”5” || "$TEST" == “$RESULT” ]]

Read more about conditional statements at:

https://brainly.com/question/24833629

What is a value which we pass to the function to use in place of the parameter when we call it?

A. Parameter
B. Call
C. Procedure
D. Argument

Answers

Answer:
D) Argument

Explanation:
When you call a function, you pass in an argument as the input to use in the place of the parameter.

What are the four steps of the binary search algorithm

Answers

Answer:

Step 1 - Read the search element from the user.

Step 2 - Find the middle element in the sorted list.

Step 3 - Compare the search element with the middle element in the sorted list.

Step 4 - If both are matched, then display "Given element is found!!!" and terminate the function.

Answer:

These are the main steps are given the photo below

I hope my answer helps you.

what is an example of fibre optic cable

Answers

Answer:

printing cable

Explanation:

is a cable used to transfer information from a computer to the printer in packages

A set of activities that performs across the organization creating as output of values to the customer
a.
Business process
b.
Customer process
c.
Quality process
d.
Software process
e.
Integrated process

Answers

the correct answer is A : Business Process

What is the binary of the following numbers
10
6
22
12

Answers

You can use this table to help you!

Answer:

10 = 00001010

6 = 00000110

22 = 00010110

12 = 00001100

A laser printer uses...........
A. Correction fluid
B. Ink cartridge
C. Photocopy ink
D. Toner cartridge ​

Answers

Answer:

Toner cartridge

Explanation:

Which is the best explanation for why tutorials are useful?

Answers

Answer:

Tutorials are important for your learning because you can:

Solve problems in a team, develop your group skills, and get to know your peers better (which may come in handy when picking group members for group projects) Prepare for and/or review midterms and exams. Clarify any concepts that you might not understand.

Explanation:

Hope it helps

9.3 code practice

Write a program that creates a 4 x 5 array called numbers. The elements in your array should all be random numbers between -30 and 30, inclusive. Then, print the array as a grid.

For instance, the 2 x 2 array [[1,2],[3,4]] as a grid could be printed as:

1 2
3 4
Sample Output
18 -18 10 0 -7
-20 0 17 29 -26
14 20 27 4 19
-14 12 -29 25 28
Note: the numbers generated in your program will not match the sample output, as they will be randomly generated.

pls help

Answers

The program is an illustration of arrays; Arrays are variables that are used to hold multiple values of the same data type

The main program

The program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

#include <cstdlib>

#include <ctime>

using namespace std;

int main(){

   //This declares the array

   int myArray[4][5];

   //This seeds the time

   srand(time(NULL));

   //The following loop generates the array elements

   for(int i = 0; i< 4;i++){

       for(int j = 0; j< 5;j++){

       myArray[i][j] = rand()%(61)-30;

   }    

   }

   //The following loop prints the array elements as grid

   for(int i = 0; i< 4;i++){

       for(int j = 0; j< 5;j++){

       cout<<myArray[i][j]<<" ";

   }    

   cout<<"\n";

   }

   return 0;

}

Read more about arrays at:

https://brainly.com/question/22364342

The major goal of a good web information
a
retrieval system is

Answers

Answer:

Explanation:

The major objective of an information retrieval system is to retrieve the information – either the actual information or the documents containing the information – that fully or partially match the user's query.

The implementation of mutex locks provided in Section 6.5 suffers from busy waiting. Describe what changes would be necessary so that a process waiting to acquire a mutex lock would be blocked and placed into a waiting queue until the lock became available.

Answers

The changes would be necessary so that a process waiting to acquire a mutex lock would be blocked and placed into a waiting queue is: Spinlocks.

What is spinlock?

Spinlock can be defined as the process of enabling a thread to  wait while looking for lock that are available.

Spinlock is important as it enable thread to partition processor based on their needs so as to make it possible for thread waiting for spinlock to make use of one processor while other threads can as well run on other processor without hindering or interrupting one another.

Inconclusion the changes would be necessary so that a process waiting to acquire a mutex lock is: Spinlocks.

Learn more about spinlock here:https://brainly.com/question/13766808

Explain the main concept of Artificial Neural networks (ANN) as a set of layers that starts with an input layer that has sensors and the output layer that gives the predicted result (predictions) with hidden layers in between based on the ANN architecture and its specific type of application Knowledge One Individual Practical Assignment

Answers

Artificial Neural networks is a computational tool that is made up of a let of processing elements that takes in inputs and deliver outputs using a predefined activation codes.

What are the layers in an artificial neural network?

There are 3 Artificial olfactory sense and recognition system that are found in ANN.  It is made up of:

An input layer.An Hidden layer.An Output layer.

Note that these layers above help to tell more about the Artificial Neural networks (ANN).

Learn more about  Artificial Neural networks (ANN) from

https://brainly.com/question/25653113

Look at the lines that say health, dental, and retirement which statement below is accurate

Answers

The statement that is accurate is that Those lines represent insurance and retirement plans that Hope funds directly from her paycheck.

What is a retirement plan?

A retirement plan is known to be a type of plan that has been set up to take handle all the needs of a post-retirement days.

This was designed to help a person have a stress-free life. A retirement savings plan is one that helps to  your money to grow and care for your  life.

See full question below

Look at the lines that say HEALTH, DENTAL, and RETIREMENT. Which statement below is accurate? Those lines represent taxes that Hope paid to the Federal government b. Those lines represent taxes that Hope paid to the state government Those lines represent benefits that the employer is paying to Hope in addition to her wages d. Those lines represent insurance and retirement plans that Hope funds directly from her paycheck

Learn more about  retirement plans from

https://brainly.com/question/12143528

PLEASE HELP WILL MARK BRAINLIEST

Answers

Answer:

Ok, first what do u think their action is saying/doing, then state if it's effective or ineffective.

Explanation:

what is the name of the extension used to save publisher

Answers

Answer:

PUB

Explanation:

PUB IS THE NAME OF THE EXTENSION USED TO SAVE PUBLISHER

Use HTML and CSS, create a web page for the table shown below. Please copy (and paste) your code from your text editor (Replit).



Answers

This is big sorry I can’t do it

"You have created a Word document named apple.docx using Microsoft Word. What type of a file is apple.docx ? Select all that apply"

Answers

The type of a file that is in  apple.docx is Executable program file.

What is an executable file?

An executable file (EXE file) is known to be a type of computer file that has a encoded sequence of codes or instructions that the system often work on  when the user is said to clicks the file icon.

Note that Executable files are known to have an EXE file extension, and there are a lot of other executable file formats. The type of a file that is in  apple.docx is Executable program file.

Learn more about Word document from

https://brainly.com/question/25567167

3.10 LAB: List basics
Given the user inputs, complete a program that does the following tasks:

Define a list, my_list, containing the user inputs: my_flower1, my_flower2, and my_flower3 in the same order.
Define a list, your_list, containing the user inputs, your_flower1 and your_flower2, in the same order.
Define a list, our_list, by concatenating my_list and your_list.
Append the user input, their_flower, to the end of our_list.
Replace my_flower2 in our_list with their_flower.
Remove the first occurrence of their_flower from our_list without using index().
Remove the second element of our_list.
Observe the output of each print statement carefully to understand what was done by each task of the program.

Ex: If the input is:

rose
peony
lily
rose
daisy
aster
the output is:

['rose', 'peony', 'lily', 'rose', 'daisy']
['rose', 'peony', 'lily', 'rose', 'daisy', 'aster']
['rose', 'aster', 'lily', 'rose', 'daisy', 'aster']
['rose', 'lily', 'rose', 'daisy', 'aster']
['rose', 'rose', 'daisy', 'aster']

Answers

The program is an illustration of Python lists; lists are used to hold multiple values in a variable

The main program

The program written in Python, where comments are used to explain the code is as follows:

#This gets all required outputs

my_flower1 = input(); my_flower2 = input(); my_flower3 = input(); your_flower1 = input(); your_flower2 = input(); their_flower = input()

# This defines my_list and appends the values of my_flower1, my_flower2, and my_flower3

my_list=[my_flower1,my_flower2,my_flower3]

# This defines your_list and appends your_flower1 and your_flower2

your_list=[your_flower1,your_flower2]

# This defines our_list by and concatenates my_list and your_list

our_list = my_list+your_list

#This prints our_list

print(our_list)

# This appends their_flower to the end of our_list

our_list.append(their_flower)

#This prints our_list

print(our_list)

# This replaces my_flower2 in our_list with their_flower

our_list[our_list.index(my_flower2)]=their_flower

#This prints our_list

print(our_list)

#This removes the first occurrence of their_flower from our_list

our_list.remove(their_flower)

#This prints our_list

print(our_list)

#This removes the second element of our_list

our_list.remove(our_list[1])

#This prints our_list

print(our_list)

Read more about python lists at:

https://brainly.com/question/16397886

Difference between centralized and decentralized processing in computer

Answers

Answer:

Centralized computing is analogous to star topology in the networks where there is n entry and n-1 exit points. We see all the computation being carried out by the pivot processor and also embed in itself a decision routine for pass on the message to other linked systems. These systems are merely the mirror whereas the computing is done by the pivot processor.

Decentralized Computing is analogous to distributed node based processing where the topology for interaction among the nodes are random and hence some times there is delay because of the orientation of nodes by since the computation is disperse, it compensates in the time in processing, storage and retrieval.

You can definitely check into IBM and Amazon Research for examples for the Centralized and Decentralized computing.

Rewrite the following pseudocode segment using a loop structure in the specified languages: k = (j + 13) / 27 loop: if k > 10 then goto out k = k + 1 i = 3 * k - 1 goto loop out: . . . a. C, C++, Java, or C# b. Python c. Ruby Assume all variables are integer type. Discuss which language, for this code, has the best writability, the best readability, and the best combination of the two.

Answers

The pseudocode is simply the prototype of the actual program in C, C++, Java, C#, Python or Ruby

The program in C++

The pseudocode written in C++ language is as follows:

#include<iostream>

using namespace std;

int main(){

    int i, j, k;

    cin>>j;

    k = (j + 13) / 27;

    while (k > 10){

    k+=1;    

    i = 3 * k - 1;

    }

    return 0;

}

The program in Python

The pseudocode written in Python language is as follows:

j = int(input())

k = (j + 13) / 27

while (k > 10):

    k+=1    

    i = 3 * k - 1

The program in Ruby

The pseudocode written in Ruby language is as follows:

j = gets.chomp.to_i

k = (j + 13) / 27

while k > 10

    k = k + 1    

    i = 3 * k - 1

The code with the best writability and readability

The code with the best writability is C++ and the code with the best readability is the Ruby

The best combination of the two

The best combination of the two languages is the Python language

Read more about pseudocode at:

https://brainly.com/question/11623795

The first three elements of the Continuous Delivery Pipeline work together to support delivery of small batches of new functionality which are released in accordance with what?

Answers

Answer:

is Market needs

Explanation:

The first three elements of the continuous delivery pipeline mediates the support to the small batches thereby to be released in accordance with the market demand.

What is continuous delivery pipeline?

The continuous delivery pipeline can be given as the software application that enables the development of the new code with the automation to speed.

The first three elements of the continuous delivery pipeline are Continuous Exploration (CE), Continuous Integration (CI), and Continuous Deployment (CD).

The elements mediates the support to the small batches to be released in accordance with the market demand.

Learn more about continuous delivery, here:

https://brainly.com/question/14402781

#SPJ2

A set of processes and procedures that transform data into information and knowledge is
a.
Computer system
b.
Business system
c.
Database system
d.
Knowledge system
e.
Information system

Answers

Answer:

the answer is information system

A set of processes and procedures that transform data into information and knowledge is an Information system, which is the correct answer that would be an option (D).

What is the information system?

Information system(IS) refers to systematic, social, and technical, organizational systems that obtain, process, store, and distribute information. Information systems are made up of four components from a socio-technological standpoint: task, people, structure (or roles), and technology.

A computer information system is a system that processes or interprets data that is made up of people and computers.

The term is also used in more limited contexts to refer only to the software used to run a computerized database or to refer only to a computer system.

Thus, a set of processes and procedures that transform data into information and knowledge is an Information system.

Hence, the correct answer would be an option (D).

To learn more about the Information system click here:

https://brainly.com/question/28945047

#SPJ2

For each of the following agents, describe all the possible PEAS (Performance, Environment, Actuators, and Sensors) and then identify the environment type. Self-vacuum cleaner  Speech recognition device Drone searching for a missing person Computer playing chess Alexa/Siri performing as a smart personal assistant.​

Answers

The PEAS environment type is a task environment space that is used in the evaluation of performance, the environment, the sensors and the actuators.

How to identify the environment type

For all of the options listed here, the environment types have to be put in tables. The table has been created in the attachment I added.

The use of PEAS helps in the performance of tasks in an independent way.

Read more on performance evaluator here: https://brainly.com/question/3835272

What command is used to list at jobs that are scheduled for execution?

Answers

The command that is used to list at jobs that are scheduled for execution is The at command.

What is the at command?

This is known to be a kind of  a Linux command-line utility. It function mainly to book down a job for future execution.

Conclusively. This kind of utility is one that reads commands from standard input and them bind them together into an at job, which can only be executes only once at a time.

Learn more about command  from

https://brainly.com/question/25808182

Mike logged into a shopping website and entered his username and password. Which protocol will the website use to verify his credentials?

Answers

Answer:

I think it is email or password

every CAD application comes with a color menu to help you tailor your selections, mix them properly, and apply them in ways that meet your artistic expectations

true or false

Answers

every CAD application comes with a color menu to help you tailor your selections, mix them properly, and apply them in ways that meet your artistic expectations is a true statement.

What is a color CAD?

In a CAD system, there is found to be colors that are known to be often and  most commonly used to depict line weights.

Note that selecting different colors is easy using varying line thickness. One can then use these colors into layers to smooth the visibility of drawing components that you wants.

Learn more about CAD application  from

https://brainly.com/question/9222927

Answer:true

Explanation:

Name three things that get information into a computer?​

Answers

Answer:

Input devices do that. Three are the keyboard, a mouse, and a trackball.

Explanation:

Difference between single dimensional array and double dimensional array​

Answers

A one-dimensional array keeps track of a single list of elements with the same data type. An array of various arrays, a list of multiple lists, or an array of numerous one-dimensional arrays are all stored in a two-dimensional array. It is a list that represents several data pieces.

Identify three (3) general-purpose computing devices and write a short (no more
than one page) essay explaining in detail the computing process

Answers

The three (3) general-purpose computing devices used around the world are:

Desktop computersSmartphoneTablet

What is computing?

Computing refers to a process which involves the use of both computer hardware and software to manage, analyze, process, store and transmit data, so as to complete a goal-oriented task.

In Computer technology, a general-purpose computing device is a type of computer that can perform most common computing tasks when provided with the appropriate software application. Thus, three (3) general-purpose computing devices include the following:

Desktop computersSmartphoneTablet

Read more on computing here: https://brainly.com/question/19057393

Other Questions
70 points - Completa las oraciones con la frase que corresponde. (Complete the sentences with the corresponding phrase.) 1 Despus de ir de compras, Maribel quiere a. cuando Enrique va a comprar las entradas 2 Enrique no quiere ir al teatro porque b. volver al centro 3 Maribel y Enrique van c. a un concierto de msica rock en la tarde 4 El autobs llega d. Y tiene la camiseta 5 Enrique va a comprar las entradas e. las entradas cuestan mucho No spammers pls and also giving brainliest to correct answer please help. I will mark brainliest .... thanks so much Pleaseee help Im so confused How many congruent faces does the square pyramid below have?A. 5B. 6C. 4D. 2 Find the missing length. Round to the nearest tenth, if necessary. A right triangle has legs measuring 8 units and x units and a hypotenuse measuring 21 units. Writing Expressions and Equations the product of 6 and 11 how did the appearance of mendels F generation differ from the appearance of the P generation? What was her speed?0.1 mile per minute0.5 mile per minute5 miles per minute10 miles per minute Which of the following data sets are NOT likely to be normally distributed?The day of the month on which randomly selected students were bornThe day of the month on which randomly selected students were bornThe final exam scores of all students taking the same class and given the same final exam in a large school districtThe final exam scores of all students taking the same class and given the same final exam in a large school districtThe number of wheels on the next 100 vehicles that pass by a point along a highwayThe number of wheels on the next 100 vehicles that pass by a point along a highwayThe heights of tenth-grade male students at a large high schoolThe heights of tenth-grade male students at a large high schoolThe IQs of the students at a large high school Krista Kellman has an opportunity to purchase a government security that will pay $200,000 in 5 years. Outline the biochemical pathways which enables cells to produce energy using glucose and oxygen please help urgent math photo attached If the figure is a net of a square pyramid, drag it to the Nets of Square Pyramids column.If the figure is not a net of a square pyramid, drag it to the Not Nets of Square Pyramids column. the following are the instrument if the brass family excepta.french horn b.tuba c.trumpet d.cello All of the following impactedthe origin of capitalism afterthe ending of feudalismexcept theA. Age of ExplorationB. Protestant ReformationC. Enlightenment era You are considering the two different car loans. Using the payment table, which loan has the lowest monthly payment? The electromagnetic spectrum is the complete range of electromagnetic radiation ranging from radio waves to gamma rays. Which type of radiation in this spectrum is associated with observable colors such as red, green, and blue?. URGENTTTTT Describe the graph of f(x)=-3(x+1)^2 (x-3) (x-5)^3. Include as much information in your description as possible.(i will not click on links so dont even try-) P=1/2 q=-1/3r=1/5 30pqr(p+q+r)/(p+q)(p+r)Answer -22/7