Write a procedure that takes a positive integer as a parameter. If the number given to the procedure is no more than 30, the procedure should return the absolute difference between that number and 30. If the number is greater than 30, the procedure should return the number doubled.

Answers

Answer 1

Answer:

The following code is written in C++

#include<iostream.h>

int main()

{

int n;

cin>>" Enter Number>>n;

if(n < 30)

      {

            cout<<"Absolute Difference is 30";

      }

else

       {

             cout<<"Absolute Difference is "<< 2*n;

       }

return 0;

}


Related Questions

What will be the output of the following code?
#include
void fun(int);
int main()
{
int a=3;
fun(a);
return 0;
}
void fun(int n)
{
if(n>0)
{
fun(--n);
printf("\n%d",n);
fun(--n);
}
}

Answers

Answer:

The output is 0, 1, 2, 0

Explanation:

The C source code defines a void function called 'fun'. The fun function is a recursive function that is used to recursively count through a number excluding the last number, the function accepts an integer value to be counted.

Answer:

to be honest I don't know

your teacher has accidentally put the wrong names of the students on her excel science results sheet. What method can be used to change the names to the correct names why is it better to do these result sheet on the computer rather than on paper answer by brainly​

Answers

Answer:

Explanation:

Excel has a built-in function that allows you to type in a word, letter, or number and it will automatically find every one of that entry and replace it with whatever you want. To do this you simply click on Home > Find & Select > Replace and fill out the information. Once the info is completed click Replace All. This shows exactly why it is way better to do these result sheets on the computer as opposed to on a piece of paper, it allows you to automate everything and fix multiple mistakes with a simple button click.

Which tool adds different amazing effects to a picture.

(a) Paint

(b) Lines tool

(c) Magic tool​

Answers

Answer:

magic tool

Explanation:

Docker is focused on ______ containerization.

Answers

Answer:

Application

Explanation:

Docker is a known container technology platform that can help in the packaging of an application by a developer. It is a platform that is used by software developers to build applications based on containers. Using this containerization platform would enable the application to run without issues In any environment. That is either development, test or production environment.

This can change the fit of your respirator. A) A mustacheB) A beardC) Weight gainD) All of the above

Answers

Answer:

D) All of the above

Explanation:

"Fit testing" is important when it comes to respirators. This ensures the respiratory safety of the wearer. When it comes to tight-fitting respirators, a good fit is very important. This means that the respirator will seal to the skin, so it is important not to have any facial hair like beards, mustache, or stubble. OHSA requires that the person should be clean-shaven.

Fit testing is also done annually in order to adjust to any physical changes such as weight gain or dental work. So, all of the choices above can change the fit of the respirator.

Where are functions stored?

in the development environment or on the Internet

in the development environment or in an individual program

in an individual program or on a computer’s hard drive

in an individual program or in a lookup table

Answers

Answer:

In the development environment or in an individual program

Explanation:

A function in programming is a code or lines of code that perform a particular function.

They are stored in the development environment or in an individual program so they can be called up and execute when needed.

please help me please help me​

Answers

Explanation:

in C++

#include<iostream.h>

#using namespace std;

main()

{

int array[8];

int oddSum=0;

for(int i=0; i<8;i++)

{

if(array[i]%2==1)

{

oddSum=oddSum+array[i];

}

else()

{ //do nothing }

}

cout<<"The sum of odd numbers are:"<<oddSum;

getch();

return 0;

}

Which of the following is one of the first steps in implementing a comprehensive security program? Setting up a Guest account Creating hierarchical directory structures Setting a strong password policy Establishing forests

Answers

Answer:

Setting a strong password policy

Explanation:

In implementing a comprehensive security program, one of the first steps would be to set up a strong password policy.

It is important to understand what the company is trying to protect from third parties.

Setting up a password policy is going to increase the security of the system through the use of strong passwords.

1. What is the primary tool that Windows Server administrators use to create and manage user accounts

Answers

Answer to you questions is: Active Directory

Which option is used to ensure the integrity and authenticity of a Word document but requires additional services to be available on the internal network? digital encryption digital signature password protection protected view

Answers

Answer:

Digital signature.

Explanation:

Digital signature is used to ensure the integrity and authenticity of a Word document but requires additional services to be available on the internal network.

This is important as it makes sure that the file is authentic and not malware.

Answer:

digital signature

Explanation:

got it right on edge

1) If a robot has a 3 bit instruction set and needs 20 instructions to reach its destination, how many bits of memory are required?


2) A robot driven by a raspberry Pi has 256MB of memory. The robot has a 3 bit instruction set. What is the maximum number of instructions that can be loaded into the robot?

3) Imagine that the robot with 256MB of memory needs 500,000 4-bit instructions to perform a job. Would it be possible to load in all the 500,000 instructions into the memory of the robot?

Answers

Answer:

Explanat500,000ion:

Pls due soon



Directions: Answer these questions as you navigate through the modules of the Computer Basics Tutorial.



Define computer:

What are the functions of a computer?

Name three ways in which you can use a computer?

Define hardware:

Define software:

Name at least four different types of computers.

What are the two main styles that personal computers come in?

What is the purpose of the operating system?

Name the three most common operating systems for PCs.

What does GUI stand for and what is its purpose?

In what year did Microsoft create Windows?

What is MAC OS?

What is Linux?

Name three operating systems designed specifically for mobile devices?

What is an App?

What are apps for mobile devices called?

Name six types of desktop applications?

Name three examples of mobile apps (does not have to come from the tutorial)?

What is the Cloud?

Name three services that use the Cloud?

Give at least one reason why someone would want to use the Cloud.

Give three examples of web apps?

What are the basic parts of a desktop computer and what purpose does each one serve?

Name two common mouse alternatives?

Name at least five peripherals?

What is the CPU/Processor of a computer?

How is the processor’s speed measured?

What is the motherboard and what purpose does it serve?

What does the power supply unit do?

What is RAM and what is it measured in?

What is a hard drive and what purpose does it serve?

What is the purpose of each of the following:

expansion card

video card

sound card

network card

Bluetooth card

What is a laptop computer and how is it different from a desktop computer?

What is a mobile device? Give three examples.

What is a smartphone?

What are 3G, 4G, and LTEs?

How is a tablet computer different from a laptop? What are some advantages and disadvantages of using a tablet?

What is the desktop and what features does it usually contain?

What is the purpose of using folders on the computer?

What is the purpose of the Recycle Bin?

Name three things you need to access the Internet?

Describe each of the following common types of Inter services:

Dial-up

DSL

Cable

Satellite

3G and 4G

What are some things you should consider when you are choosing and Internet Service Provider?

What is a modem?

What is a router?

What is a network card?

What does Wi-Fi stand for?

What is a web browser and what is its main job?

What is the World Wide Web?

Name three different types of web browsers?

Explain the following security terms:

SSID:

Encryption password

Encryption

Passphrase

What steps do you need to take to keep your computer healthy?

How do you deal with spilled liquid on your keyboard?

How do you clean the mouse and the monitor?

What is malware and what does it include? What is the best way to guard against malware?

In what ways can you back up your computer?

Name several techniques to maintain your computer?

Define computer ergonomics.

What are four general tips to keep in mind when troubleshooting your computer?

What is a flash drive?

What is Cloud storage?

What is the proper way to safely remove a flash drive from the computer?

Name three free popular services that allow you to save data to the Cloud?

What are accessibility features? Name three?

Name three assistive technology devices and what they are used for?

Answers

Answer:

Software for personal computers is typically developed and distributed independently from the hardware or operating system manufacturers. Many personal computer users no longer need to write their own programs to make any use of a personal computer, although end-user programming is still feasible. This contrasts with mobile systems, where software is often only available through a manufacturer-supported channel. And end-user program development may be discouraged by lack of support by the manufacturer.

Explanation:

What is the top anime shows? <3

Answers

Answer:

This is personally based on my opinion.

My top 10 favorites

Toradora

Darling in the franxx

Lucky Star

My Melody

Death note

Attack on titans

One piece

The Promise neverland

Kaguya-sama: love is war

Black cover

Answer:

This is just my opinions as of rn

Explanation:

Attack on Titan

Hunter x Hunter

Saiki K

Haikyu!!

The Promised Neverland

Toilet Bound Hanako-kun (The manga is amazing.)

Ouran High School Host Club

Given

Yuri on Ice!!!

Hetalia

some close runner ups were

Toradora

A Silent Voice

Anohana

Kakegurui

and Black Butler

The other anime i've seen were either movies and shows I watched as a kid or I just couldn't think of them right away

An algorithm is Group of answer choices The part of the computer that does the processing A complete computer program The inputs and outputs of a program A finite set of steps to solve a problem

Answers

Answer:

A finite set of steps to solve a problem

Explanation:

From the list of given options, option D describes an algorithm

Other options such as:

(A) describes the CPU of a computer;

(B) describes a written program which is achieved with the use of one or more programming languages

and (C) which describes the data that is being supplied into the program and also the information expected from the program.

Hence:

(D) is correct

Debug the code in the main method of this class, which is intended to initialize an array named arr to hold 3 ints, fill this with 3 inputs from the user, then print the contents of the array in order followed by the sum.
Here's the code that needs to be fixed:

import java.util.Scanner;

public class U6_L1_Activity_One{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int[] arr = new int(3);
arr[1] = scan.nextInt();
arr[2] = scan.nextInt();
arr[3] = scan.nextInt;
System.out.println("Contents: " + arr{1} + " " + arr{2} + " " + arr{3});
System.out.println("Sum: " + arr[1] + arr[2] + arr[3]);
}
}

Answers

Answer:

import java.util.Scanner;

public class U6_L1_Activity_One{

 public static void main(String[] args){

   Scanner scan = new Scanner(System.in);

   int[] arr = new int[4];

   arr[1] = scan.nextInt();

   arr[2] = scan.nextInt();

   arr[3] = scan.nextInt();

   System.out.println("Contents: " + arr[1] + " " + arr[2] + " " + arr[3]);

   int Sum = (1 + 2 + 3);

   System.out.println("Sum: " + Sum);

 }

}

Explanation:

Debugging a code involves locating and correcting the errors in the code.

The errors in the code are:

Invalid array declaration and indexingImproper usage of the scanner objectIncorrect syntax of sum

So, the corrected code segment is as follows:

        int [] arr = new int[3];

       arr[0] = scan.nextInt();

       arr[1] = scan.nextInt();

       arr[2] = scan.nextInt();

       System.out.println("Contents: " + arr[0] + " " + arr[1] + " " + arr[2]);

       System.out.println("Sum: " + (arr[0] + arr[1] + arr[2]));

Read more about debugging at:

https://brainly.com/question/18844825

When is historical data not useful

Answers

Answer:

to address for setting cost increase of a resource to determine the amount of money needed for a future project to plan for future years operation costs to predict sales based on past growth

How many total cells can a worksheet window contain? If columns are labelled alphabetically, what will be the label for the cell in row 1, column 16,384?

Answers

Answer:

[tex]5815 {20 \frac{55}{ \\ hii \: \\ \\ } }^{?} [/tex]

und bedding
200
Question 2
A Column is 0.5 m diameter and carries a load of 600 Kofker from the controid by
0.1. calculate the extemes of stresses.
Question 3​

Answers

Answer:

The stress for tensile edge is 1.834 MPa

The stress for compressive edge is -7.945 MPa

Explanation:

Given that,

Force = 600 kN

Diameter = 0.5 m

[tex]y=\dfrac{D}{2}=\dfrac{0.5}{2}=0.25\ m[/tex]

Distance from the centroid to the edge of the column x= 0.1  m

We know that,

Stress for column :

The stress is equal to the sum of banding stress and direct compressive stress.

[tex]\sigma=\sigma_{b}+(-\sigma_{d})[/tex]

The value of binding stress will be positive for tensile and negative for compressive stress.

We need to calculate the stress for tensile edge,

Using formula of stress for tensile edge,

[tex]\sigma=\dfrac{Fxy}{I}-\dfrac{F}{A}[/tex]

Put the value into the formula

[tex]\sigma=\dfrac{600\times1000\times0.1\times0.25}{\pi\times\dfrac{(0.5)^4}{64}}-\dfrac{600\times1000}{\pi\times\dfrac{(0.5)^2}{4}}[/tex]

[tex]\sigma=1.834\ MPa[/tex]

We need to calculate the stress for compressive edge,

Using formula of stress for compressive edge,

[tex]\sigma=-\dfrac{Fxy}{I}-\dfrac{F}{A}[/tex]

Put the value into the formula

[tex]\sigma=-\dfrac{600\times1000\times0.1\times0.25}{\pi\times\dfrac{(0.5)^4}{64}}-\dfrac{600\times1000}{\pi\times\dfrac{(0.5)^2}{4}}[/tex]

[tex]\sigma=-7.945\ MPa[/tex]

Hence, The stress for tensile edge is 1.834 MPa

The stress for compressive edge is -7.945 MPa

What is the value in y2 when the code show below executes?
x1 = [ 5 3 1 7 9]; [y1 y2] = min(x1)

Answers

Answer:

y2 = 3

Explanation:

This question needs us to give the value of y2 when we run this code in the question.

By min(X1) it is asking for the minimum value in the list of values that we have in the question.

Y1 is the first minimum value in the list and it is = 1

Our answer of interest in this solution is to, which is the second minimum value in the list after Y1

Therefore y2 = 3

Thank you!

where do you access to header section in excel?​

Answers

Answer:

On the Insert tab, in the Text group, click Header & Footer. Excel displays the worksheet in Page Layout view. Click the left, center, or right header or footer text box at the top or the bottom of the worksheet page.

Explanation:

What are some of the issues that create conflict in the future and why?

Answers

Answer:

Some of the reasons for future conflict between nations could be:

Explanation:

1: water wars, this is something possibly brewing between Ethiopia and Egypt with Sudan being on Ethiopia's side as the dam Ethiopia plans to build which would take a lot of Egypt's water would also power Sudan with electricity. Oh and something frightening could happen as China is damming India's major rivers which could lead to a world war or India becoming a Chinese vassal and massive amounts of displaced and starving people either way.

2: a global economic drop: this will severely impact the economies of many countries, especially countries in the middle of industrialization in Africa which are very fragile, I will give it a few decades to fully blow up there.

3:Competing interests, ethnic and international for example in Central Asia there are a lot of competing influences and something could happen there but thing is wars because of what I just mentioned are already happening, look at Syria with the "moderate" rebels, between Armenia and Azerbaijan we have had a conflict which had several geopolitical implications and reasons it went as it did, currently Libya is in a proxy war too, and recently Ethiopia has had conflicts within a Northern region which are heavily ethnic-based and could lead to an Ethiopian civil war if the government does not manage to solve this, which would also mean the first war I mentioned would be delayed or prevented trough another bloody war.

4: an incident: many wars have started because of incidents escalating, so watch out for it, for example earlier this yea- oh it's been a year already since Qasem Soleimani was assasinated , however luckily nothing happened then.

Either way we're gonna have more wars before world peace and mercenaries are becoming more popular like Turkey and more countries are using in proxy wars and another thing you should watch out for is the first use of robots in war and hope that they distinguish between regular humans and soldiers and don't commit atrocities, happy 2021!

Which functions are part of the array module? Select 2 options. Assume you have already entered these
lines of code.
import array
arr = array array('b',[5, 1, 2, 7, 6])
arr.sort()
arr.search(3)
O arr.index(3)
arr.append(3)
arr.find(3)

Answers

Answer:

arr.index(3)

arr.append(3)

Explanation:

Edge2020

What is the proper order for the fetch-execute cycle?

A) fetch, decode, execute, store
B) store, fetch, execute, decode
C) fetch, execute, decode, store
D) fetch, store, decode, execute

Answers

Answer:

A. fetch, decode,execute, store

The fetch-execute cycle is a computer's fundamental operation cycle. The correct option is A.

What is a fetch-execute cycle?

The fetch-execute cycle is a computer's fundamental operation (instruction) cycle (also known as the fetch decode execute cycle). The computer obtains a software instruction from memory during the fetch execute cycle. It then establishes and executes the activities necessary for that instruction.

The proper order for the fetch-execute cycle, decode, execute, store.

Hence, the correct option is A.

Learn more about the fetch-execute cycle:

https://brainly.com/question/17412694

#SPJ2

write a valid HTML + Python page that will count numbered from 1 to 1,000,000?​

Answers

Answer:

I remember before the corona virus we used to do math at school

Think about the ways new communication technologies can make certain tasks easier for
users with disabilities. For two categories of individuals with disabilities (e.g., the blind,
deaf, restricted mobility, etc.), explain one way that everyday technology helps them.
Describe the specific way the technology improves their lives.

Answers

Technology gives them the ability to do things that they normally couldn’t do. Like deaf people could get a cochlear implant to make them hear, people without a leg can get a prothetic leg to help them walk. Even something as simple of being colorblind, there are glasses to help them see color. It’s amazing.

Name and define two ways an IDS connects to a network.

Answers

Answer:

The two ways an IDS connects to a network are:

1. Signature-based detection uses patterns by establishing a unique identifier for the detection of future cyber attacks, using the IDS sensors and consoles.

2. Statistical anomaly-based detection, as an expert system, relies on the identification of anomalies in the network traffic by comparing against established baselines.

Explanation:

Organizations use the Intrusion Detection System (IDS) as a software program to detect a computer network attack in an effort to stop the attack.  The program analyzes the network traffic for signatures of known cyberattacks and the delivery of network packets.  There are two types: NIDS and HIDS.  Whereas a Network Intrusion Detection System (NIDS) is designed to support multiple hosts, a Host Intrusion Detection System (HIDS) is set up to detect illegal cyber actions in a host's operating system files.

When adding color to an html document, you can use the color name or
the color number
Choose
False
True

Answers

Answer:

True

Explanation:

Sonja is writing a program to compare two numbers and print the larger number. Which of these should be used?
a while loop
if and else
if, elif, and else
a string variable

Answers

Answer:

if and else

Explanation:

if (num1 > num2):

   print(num1)

else:

   print(num2)

Cards in a pack are black or red in the ratio
black: red = 2 : 5
What fraction of the cards are red?​

Answers

Answer:

[tex]Fraction = \frac{5}{7}[/tex]

Explanation:

Given

[tex]black: red = 2 : 5[/tex]

Required

Determine the fraction of red

First, we calculate the total ratio.

[tex]Total = black + red[/tex]

Substitute values for black and red

[tex]Total = 2 + 5[/tex]

[tex]Total = 7[/tex]

The fraction of red is then calculated as:

[tex]Fraction = \frac{Red}{Total}[/tex]

[tex]Fraction = \frac{5}{7}[/tex]

In a binary search, which formula is used to find the index of the middle value?


middle = (first + last) * 2


middle = (first + last) // 2


middle = first + last // 2


middle = first + last * 2

Answers

Answer:

middle = (first + last) // 2

Explanation:

In binary search algorithm, the searching begins at the middle index and if the value searched for is not the middle element, it progresses to the left or right of the element depending on the size of the value compared to the middle element.

To determine the middle index, you add the first index to the last index and divide the result by 2. By doing this you eliminate half of the elements you have to search through.

Subsequent divisions eventually gets you to the element you're searching for in lesser time compared to if you had to search through every element in the array.

Other Questions
OMG PLZ HELP BEING TIMED In this excerpt from Snow-White and Rose-Red by the Brothers Grimm, which sentence shows that the two sisters are inseparable? There was once a poor widow who lived in a lonely cottage. In front of the cottage was a garden wherein stood two rose-trees, one of which bore white and the other red roses. She had two children who were like the two rose-trees, and one was called Snow-white, and the other Rose-red. They were as good and happy, as busy and cheerful as ever two children in the world were, only Snow-white was more quiet and gentle than Rose-red. Rose-red liked better to run about in the meadows and fields seeking flowers and catching butterflies; but Snow-white sat at home with her mother, and helped her with her housework, or read to her when there was nothing to do. The two children were so fond of one another that they always held each other by the hand when they went out together, and when Snow-white said: We will not leave each other, Rose-red answered: Never so long as we live, and their mother would add: What one has she must share with the other. Given the information about population in Figure 2, are you surprised by difference in size of the two armies (as represented in Figure 2b)? Why or why not? Mya is buying juice boxes for a party Please Help (Didnt find science so I put biology for subject) Samantha created part of a table to show her savings. She saved at the same rate each week.Samanthas SavingsWeek1234Money Saved$18$24Which graph shows this relationship?On a coordinate plane, a graph titled Weekly Savings has weeks on the x-axis and money saved on the y-axis. Points (1, 8), (2, 16), (3, 18), and (4, 24) are plotted. PLSSS GET THIS RIGHT Rodrigo's father has a large collection of ties. He has 6 blue ties and 12 other ties.If Rodrigo's father chose a tie at random, what is the probability that the tie would be blue?Write your answer as a fraction or whole number. PLEASE SEND HELP!ALL I NEED IS THIS ANSWER!! Show that x+y:x-y=3:2 What is the coefficient of the x4-term in the binomial expansion of (x + 3)12?12C7(3)712C812C4(3)412C8(3)8 Hoy est parcialmente nublado, pero ayer estuvo mayormente soleado.Maana habr chubascos de lluvia por la tarde. Write a compare and contrast analysis of how greg Ridley from the treasure of lemon brown changes from the beginning of the story to the end 150 word essay An indicator is used to measure the ___ Name and define two ways an IDS connects to a network. This year, Martins income is 1/4 greater than his income from last year. If s represents his income from last year, what is his income this year?a) 1/4sb) 4/5sc) 5/4sd) 4s State the probability that justifies each statement.11. If 2x+19=27, then 2x=8 1. GRO- und KLEINSCHREIBUNG: BERTRAGE DIE STZE IN DIE SCHREIBSCHRIFT!ER HASST ES, LAUT ZU SCHREIEN.SIE NAHM DAS ANGEBOT OHNE ZGERN AN.SEINE HOBBYS SIND PROGRAMMIEREN UND KONSTRUIEREN.MEHRMALIGES DURCHLESEN IST RATSAM.MIT SCHIMPFEN ERREICHT MAN GAR NICHTS.EIN ALTER TUT SICH DABEI SCHWER.ES WAR DAS BESTE, WAS ER TUN KONNTE.IHM WIRD VIEL SCHLECHTES NACHGESAGT.DIESE LSUNG SCHIEN IHM DIE EINFACHSTE ZU SEIN.IM GROSSEN UND GANZEN BEVORZUGT ER JNGERE FRAUEN.DASS DIE JUNGEN SICH DEN ALTEN BERLEGEN FHLEN, IST BEKANNT.DAS BEWEIST WIEDER EINMAL, DASS DIE ERSTEN ERLEBNISSE DIE ENTSCHEIDENDSTEN SIND.ER HAT SICH BEIM FUSSBALLSPIELEN VERLETZT.ICH GLAUBE, DASS SPAREN IM BILDUNGSBEREICH UNSINNIG IST.DASS HASTIGES ESSEN UNGESUND IST, WEISS ICH.ICH WEISS, DASS LERNEN VIEL ZEIT IN ANSPRUCH NIMMT.IM WESENTLICHEN GEBE ICH IHM RECHT.MAN TAPPT BEI DEN ERMITTLUNGEN NOCH IMMER IM DUNKELN.ER MACHT AUS ALTEM NEUES.DAS BEDEUTET, DASS ER DIE RICHTIGE NOCH NICHT GEFUNDEN HAT. In April, 287 people visited an amusement park. In May, 379 people visited the same amusement park. In June, twice as many people visited the amusement park as visited in April and May combined. How many people visited the amusement park in June? A circus has 10 performers, of which 2 are trapeze artists.What is the probability that a randomly selected performer will be a trapeze artist?Write your answer as a fraction or whole number. The word submerge comes from the Latin word submergere, which means to immerse. What is the meaning of the word submerged as it is used in paragraph 21? Find the general solution to the equation y(5) - 4y(4) + 4y(3) = 1.