Write a program segment with a do-while loop that displays whether a user-entered integer is even or odd. The code should then ask the user if he or she wants to test another number. The loop should repeat as long as the user enters 'Y' or 'y' . Use a logical OR operator in the do-while loop test expression

Answers

Answer 1

Answer:

Following is the program in C++ program

#include<iostream> // header file

using namespace std; // namespace  

int main() // main function  

{

int num1 = 0; // variable declaration  

char test;// variable declaration  

do

{

cout << " Enter the number: ";

cin >> num1; //Read the input by the user  

if (num1 % 2 == 0) // check the condition of even

cout << " number is even.\n";

else // check the condition of odd

cout << "Number is odd.\n";

cout << " Do you wanted the another test of number (y/n)? ";

cin >> test; //Read the input by user

} while (test == 'y' || test == 'Y'); //terating the loop

return 0;    

}

Output:

Enter the number:45

number is even.

Do you wanted the another test of number (y/n) Y

Enter the number:5

Number is odd.

Do you wanted the another test of number (y/n) n

Explanation:

Following are the description of program

Declared a variable "num1" as integer type and initialized as 0 to them Declared a variable "test" as char type .After that iterating the do -while loop .Read the value by the user in the "num1" variable .Check the condition of even and odd by using % operator .Read the value of test by the user .If the user enter Y or y then loop again executing otherwise not .

Related Questions

what is a type of system software that allows a user to perform maintenance type tasks​

Answers

Answer:

Computer

Explanation:

The type of system software that allows a user to perform maintenance-type tasks​ is a computer.

A computer has many programs and operating systems.

Roger is getting a $5,000 loan. Which option will allow Roger to pay off the loan and keep his payments under $100?

Answers

No roger will not be able to do that

Which statement is the best description of what a macro can do in Excel 2016? It is a type of formatting users can apply to enlarge the worksheet area. It is a file type that a user can save a workbook as. It is a series of instructions contained in one command that users can apply to automate complex and/or repetitive tasks. It is a recording function that allows you to save worksheets, audio recordings, and videos that are displayed on the screen.

Answers

Answer: It is a series of instructions contained in one command that users can apply to automate complex and/or repetitive tasks

One example would be a macro that goes through a list of numbers and highlights which are duplicates. Say you had the list {1,2,3,3,4,4,4,5}. You could use one color to highlight both 3 and 4 as they repeat themselves. Or you could use different colors to show the different values. With a small list, you could highlight by hand. However, macros are more efficient with larger lists.

Answer:

It is a series of instructions contained in one command that users can execute to automate complex and/or repetitive tasks.

Explanation:

edge 2022

Whoever answers FRIST and it has to be correct so if you don’t know don’t waste your time pls. Anyway whoever answer frist I will give you brainliest and some of my points Which type of photography would you use if you wanted to photograph a fly?

Answers

Answer:

I think Ariel photography

Explanation:

I’m not sure, but I think so

Which of the following answers refers to a system containing mappings of domain names to various types of data, such as numerical IP addresses?

Answers

Answer:

DNS or Domain Name System

Explanation:

You can query a DNS server with a domain name to get an IP address.

When approved for a loan, an individual essentially applied for aid in the area of...
A. Increasing (and financing) immediate increase in cash flow
B. limited liability
C. future educational services
D. protections and insurance

Answers

Answer:

The correct answer is A. When approved for a loan, an individual essentially applied for aid in the area of increasing (and financing), as it implies an immediate increase in cash flow.

Explanation:

Every loan involves the delivery of money by a bank or a financial agency to a person or company, with the consideration that the latter will later return said amount, plus an additional amount for interest, within a specified period and may pay in a single payment and in full or through an installment plan. But, in any case, the immediate result of said loan is an increase in the cash flow of the person who obtains said loan, which can be used for the acquisition of goods or services, or to face different eventual expenses.

Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates, it prints out, on a line by itself, the sum of all the even integers read. Declare any variables that are needed. ASSUME the availability of a variable, stdin, that references a Scanner object associated with standard input

Answers

Answer:

Written in Java Programming Language

import java.util.Scanner;

public class Assign{

   public static void main(String [] args)    {

   Scanner stdin = new Scanner(System.in);

   int num,sum=0;

   System.out.println("Start Inputs: ");

   num = stdin.nextInt();

   while (num>=0) {

       if(num%2== 0)

       {

       sum+=num;    

       }      

       num = stdin.nextInt();

   }

   System.out.print("Sum of even numbers: "+sum);

   

   }

}

Explanation:

I'll start my explanation from line 4

This line initializes Scanner object stdin

Scanner stdin = new Scanner(System.in);

This line declares necessary variables and initializes sum to 0

   int num,sum=0;

This line prompts user for inputs

   System.out.println("Start Inputs: ");

This line reads user inputs

   num = stdin.nextInt();

This line checks is user input is not negative (It's a loop that will be repeated continually until a negative number is inputted)

   while (num>=0) {

This line checks if user input is an even number

       if(num%2== 0)

       {

If the above condition is true, this line calculates the sum of even numbers

       sum+=num;    

       }      

This line prepares the user for next input

       num = stdin.nextInt();

   }

This line prints the calculated sum of even number; If no even number is inputted, the sum will be 0

   System.out.print("Sum of even numbers: "+sum);

Which is not a proper statement?

Answers

Answer:

leftisBlocked()

Explanation:

Answer: leftIsBlocked()

Hope it helps <3

a force of 50n acts on a body of mass 5kg. calculate acceleration produced .​

Answers

Answer:

Force = 50n

mass = 5kg

Force = m * acc

50 = 5 * A

A = 50/5

A = 10 m/s^2

HOPE IT HELPS!!!

Explanation:

What is Relational Computerized Database

Answers

Answer:

Relational computerized database uses tables and columns to store data. each table is composed of records and each record is tied to an attribute containing a unique value. This helps the user use the data base by search query and gives the opportunity to build large and complex data bases

The parallax perspective says that objects that are close up appear to move __________ than far away objects.

A. More smoothly
B. More randomly
C. Slower
D. Faster ​

Answers

Answer:

It appears to move faster.

To build a user interface that contains graphical components, the components ____. must each be added to a separate panel. must be added directly to a frame component. must be added to a panel that is contained within a frame. must be added to a frame that is contained within a panel.

Answers

Answer:

To build a user interface that contains graphical components, the components must be added to a panel that is contained within a frame.

Explanation:

Which is the right way to give comment if you are using Internet explorer as the browser? a) <!-- My First Webpage --> b) <comment> My First Webpage </comment>

Answers

Answer:

(a) <!-- My First Webpage -->

Explanation:

Comments in programming languages are chunks of texts, written as part of program code, that are not executed as actual code but rather used for making the program code easily readable and understandable. They allow programmers to explain certain lines of a program code.

Every programming language has its own way of representing comments. In HTML - HyperText Markup Language - comments are written between the following tags :

<!--

and

-->

For example, to put the text "My comment goes here" in a comment, we write:

<!-- My comment goes here -->

From the question, the text to be put is:  "My First Webpage". Therefore, we write;

<!-- My First Webpage -->

Which of the following statements about an inner class is true? An inner class is used for a utility class that should be visible elsewhere in the program. An inner class that is defined inside a method is publicly accessible. An inner class that is defined inside a method is not publicly accessible. An inner class that is defined inside an enclosing class but outside of its methods is not available to all methods of the enclosing class.

Answers

Answer:

(c) An inner class that is defined inside a method is not publicly accessible.

Explanation:

In programming languages such as Java, inner class (also called nested class) basically means a class inside another class or interface. The following are a few things to note about an inner class

i. Inner classes are used to group classes logically so that they are easy to use and maintained.

ii. An inner class defined inside a method of an enclosing class is not publicly accessible. They are called method local inner class

iii. An inner class that is defined inside an enclosing class but outside of its methods are available to all methods of the enclosing class

iv. An inner class has access to members, including private members, of its enclosing class.

explain any five features of a spread sheet application​

Answers

The basic features of a spreadsheet program are :

Grids, Rows & Columns. A spreadsheet consists of a grid of columns and rows.

Functions. Functions are used in the Spreadsheet software to evaluate values and perform different kinds of operations.

Formulas.

Commands.

Text Manipulation.

Printing.

Title Bar.

Menu Bar

Hope u understood!

pls mark me brainliest!

#staysafestayhome

An employee sets up Apache HTTP Server. He types 127.0.0.1 in the browser to check that the content is there. What is the next step in the setup process?

Answers

Answer:

Set up DNS so the server can be accessed through the Internet

Explanation:

If an employee establishes the HTTP server for Apache. In the browser, he types 127.0.0.1 to verify whether the content is visible or not

So by considering this, the next step in the setup process is to establish the DNS as after that, employees will need to provide the server name to the IP address, i.e. where the server exists on the internet. In addition, to do so, the server name must be in DNS.

Hence, the first option is correct

Your question is lacking the necessary answer options, so I will be adding them here:

A. Set up DNS so the server can be accessed through the Internet.

B. Install CUPS.

C. Assign a static IP address.

D. Nothing. The web server is good to go.

So, given your question, what is the next step in the setup process when setting up an Apache HTTP Server, the best option to answer it would be: A. Set up DNS so the server can be accessed through the Internet.

A server can be defined as a specialized computer system that is designed and configured to provide specific services for its end users (clients) on a request basis. A typical example of a server is a web server.

A web server is a type of computer that run websites and distribute web pages as they are being requested over the Internet by end users (clients).

Basically, when an end user (client) request for a website by adding or typing the uniform resource locator (URL) on the address bar of a web browser; a request is sent to the Internet to view the corresponding web pages (website) associated with that particular address (domain name).

An Apache HTTP Server is a freely-available and open source web server software designed and developed to avail end users the ability to deploy their websites on the world wide web (WWW) or Internet.

In this scenario, an employee sets up an Apache HTTP Server and types 127.0.0.1 in the web browser to check that the content is there. Thus, the next step in the setup process would be to set up a domain name system (DNS) so the server can be accessed by its users through the Internet.

In conclusion, the employee should set up a domain name system (DNS) in order to make the Apache HTTP Server accessible to end users through the Internet.

Find more information here: https://brainly.com/question/19341088

Consider the following scenario: The asset value of your company’s primary servers is
$2 million, and they are housed in a single office building in Anderson, Indiana. Field offices are scattered throughout the United States, but the workstations located at the field offices serve as thin clients and access data from the Anderson servers. Tornados in this part of the country are not uncommon, and it is estimated that one will level the building every 60 years. Which of the following is the SLE for this scenario?
a) $2 Million
b) $1 Million
c) $500,000
d) $33,333.33

Answers

Answer: A.) $2million

Explanation:

SLE (Single Loss Expectancy) can be explained the expected loss to be incurred whenever an asset is exposed to risk. The expected loss is valued or calculeltes in monetary terms.

The Single Loss Expectancy is calculated using the formula :

SLE = Asset value (AV) × Exposure factor

In the scenario above ;

Asset value = $2million

Exposure factor = 1 ; risk of exposure occurs once in 60 years

Therefore,

SLE = $2million × 1 = $2million

While working on an investigation, a colleague hands you a list of file creation and access times taken from a compromised workstation. To match the times with file access and creation times from other systems, what do you need to account for

Answers

Answer:

Record time offsets.

Explanation:

In this scenario, to match the times with file access and creation times from other systems, you will need to account for time offsets.

The time offset refers to the time stamp associated with different processes or tasks on a computer in nanoseconds through the operating system.

Since you've been handed a list of file creation and access times taken from a compromised workstation by your colleague, you'll need to match respectively the time the file was created to the time it was accessed by an unauthorized user.

Additionally, the time stamp varies depending on the operating system being used;

- For windows operating system, it uses a 64 bit time stamp.

- For Linux or Unix, it uses a 32 bit time stamp.

how to use command prompt​

Answers

Answer:

The answer to this question can be defined as follows:

Explanation:

The Command Prompt is a program, which available in windows operating systems, which imitates an input field with windows GUI(Graphic User Interface). It provides a text-based user interface, that can be used to run instructions inserted and carry out advanced organizational activities, following are the step to open a command prompt:

There are two-step to open the command prompt in windows:  

First, go to the start button the window. after open start type cmd on the search bar, It will provide the cmd to open it click with mouse or press enter button.    With the help of keyboard press (window+R) key together, after pressing it will provide the run prompt in which we write cmd and press enter. It will open a command prompt panel.    

Publication of flaws in encryption used for copy protection is a potential violation of: A. HIPAA B. U.S. Commerce Department regulations C. DMCA D. National Security Agency regulations

Answers

Answer:

Option C (DMCA) would be the correct choice.

Explanation:

DMCA is designed to govern electronic channels and tackle the problems the online revolution confronts regarding copyright. DMCA's mission seems to be to accommodate the rights of intellectual property producers and investors and investigate anything other than a copyrighted material that really occurs throughout the digital environment.

The other given choice are not related to the given content. So that option C is the right one.

convert the following decimal number to its equivalent binary ,octal,hexadecimal 1920​
pls in step by step
pls help me bro

Answers

Answer:

0b11110000000 is binary

0o3600 is in octal

0x780 in hexa dec.

Explanation:its a bit complitcated to explain sorry bro!

32.
To give an existing document a different name
A. retype and give it another name,
B. use the save command
C. use the same as command
D. use windows explorer to copy.

Answers

Answer:

B.

Explanation:

If you are trying to save an existing document you would use the save command and you will be prompted if you want to rename it to what ever you wish

Hope this helps :)

A data set includes data from 500 random tornadoes. The display from technology available below results from using the tornado lengths​ (miles) to test the claim that the mean tornado length is greater than 2.2 miles. Use a 0.05 significance level. Identify the null and alternative​ hypothesis, test​ statistic, P-value, and state the final conclusion that addresses the original claim. LOADING... Click the icon to view the display from technology. What are the null and alternative​ hypotheses

Answers

Answer:

The answer is:

[tex]H_0:\mu=2.2\\H_1:\mu> 2.2[/tex]

Explanation:

[tex]H_0:\mu=2.2\\H_1:\mu> 2.2[/tex]

The test value of statistic t= [tex]\frac{\bar x-\mu}{\frac{s}{\sqrt{n}}}[/tex]

                                               [tex]=\frac{2.31688-2.2}{0.206915}\\\\=0.56[/tex]

The value of P = P(T>0.56)

                          =1-P(T<0.56)

                          =1-0.712

                          =0.288

Since the P value exceeds its mean value (0.288>0.05), the null assumption must not be rejected.  Don't ignore H0. This assertion, it mean length of the tornado is greater than 2.2 miles also isn't backed by enough evidence.

You work for a public relations (PR) firm and communicate regularly with the internal team and the clients on a PR campaign. You need to quickly send and receive professional messages that may contain text files and short media. These messages need to be accessible at any time of the day and in different time zones, and they should be able to reach all members (internal and external) relatively inexpensively. Which communication channel would best suit this purpose?

Answers

Answer:

You Need To Quickly Send And Receive Professional Messages That May Contain Text Files And Short Media. These Messages Need To Be Accessible At Any Time Of The Day And In Different ... You work for a public relations (PR) firm and communicate regularly with the internal team and the clients on a PR campaign.

Explanation:

Email would likely be the best communication channel to meet these requirements. Once an email is sent, it broadcasts across servers and arrives at the recipient’s/recipients’ mailbox(es) for access at the receiving party’s/(ies’) convenience. Email is also able to have attachments, and as such, will allow for text files and smaller media files (audio, video, or otherwise) to be attached and accessed easily.
Other Questions
A standard 1 kilogram weight is a cylinder 48.5 mm in height and 49.0 mm in diameter. What is the density of the material? kg/m3 heeelp please! History class yo what extent did Yellow Journalism lead to war with spain? What benefit did the newspaper owners gain from the war? How has journalism evolved since the Spanish American War? is the told or prominence of media today likely to have a greater or lesser affect in the American public now? Fully explain your answer and give specific examples when needed at least 150 word (i will really appreciate it) Who carried out the campaign of political repression known as the Great Purge? what number must you add to complete the square x^2+4x=5 Which of the following best describes the algebraic expression 5(x + 2) - 3 ?bre "Isabel is a four-month-old baby who loves to hold onto her rattle. She shakes it repeatedly without dropping it. Which reflex is associated with how this behavior became possible?" A 90.0-kg ice hockey player hits a 0.150-kg puck, giving the puck a velocity of 45.0 m/s. If both are initially at rest and if the ice is frictionless, how far does the player recoil in the time it takes the puck to reach the goal 15.0 m away I need a story about kepler's laws for a child, something a child would understand. And i'd like it to be okay for someone if I copy anhd paste it or else my parents are gonna kill me and my teacher will be very disappointe, this is for summer school. Drag the tiles to the correct boxes to complete the pairs. Not all tiles will be used.Match each system of equations to its graph. A. Listening to music increases memory and the brains ability to process information. B. There is a mounting evidence that playing a musical instrument can improve brain function.C. Todays families are to busy with other competing activities for children to have music lessons. D. Learning to play a musical instrument can provide opportunities for enjoyment and recreation. What is the sum of the series represented by: Debra is very active. She loves to tumble and show off. She is always trying out what her parents consider to be hair-raising stunts. She also loves races and believes she can run faster than her parents. This type of activity level and confidence is most characteristic of: Which could be the graph of f(x) = |x - h| + k if h and k are both positive? On a coordinate plane, an absolute value graph has a vertex at (2, 1). On a coordinate plane, an absolute value graph has a vertex at (1, negative 4). On a coordinate plane, an absolute value graph has a vertex at (negative 3, 2). On a coordinate plane, an absolute value graph has a vertex at (negative 4, negative 5). Read the following excerpt from Henry David Thoreau's "Resistance to Civil Government." Which of these rhetorical devices does Thoreau most clearly use here? A. Rhetorical question B. Logos C. Ethos D. Metaphor Identify the accounts below that would be classified as current liabilities on a classified balance sheet. (Check all that apply.)a) Notes payable (due in three months)b) Unearned rentc) Accounts payabled) Taxes payable What is the distance between (-2. 1/2,-3) and (1, -3)? when specialized cells are grouped together to form a comman function what are they called ? A. an organism B. an ecosystem C. a community D.tissue Type your response in the box. As you read this paragraph, think about the various traits of money. On her way to work, Cara stops by her local coffee shop for tea and oatmeal to go. She pays cash and receives change. She then remembers that she needs to get gas. She fills up her cars tank, and charges it to her credit card. When her shift is over, she goes to the ATM to deposit her paycheck in her savings account. She stops home to change clothes before she goes to the gym. Not wanting to take her purse to the gym, she folds up a $5 bill and puts it in her pocket with her drivers license. When she pays for water and a banana at the gym, the clerk laughs at how old Caras $5 bill is. Cara replies that its good that all money looks the same over the past few years. List five ways this scenario references money????? can someone help me please please. Landers Flynn Inc. has 1,000 shares of $5 cumulative preferred stock outstanding. Dividends were not paid last year. The corporation also has 5,000 shares of common stock outstanding. Landers Flynn declared a $14,000 cash dividend to be paid in the current year. Required: Calculate the amount of dividends received by 1. the preferred stockholders; 2. the common stockholders. How are the Declaration of Independence and the Declaration of Sentiments like break-up letters?