1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
yawa3891 [41]
3 years ago
13

You require an algorithm that will receive an integer from the screen, add 5 to it, double it, subtract 7 from it, and display t

he final number to the screen.
Computers and Technology
1 answer:
UNO [17]3 years ago
7 0

Answer:

The algorithm is as follows:

1. Start

2. Input num

3. num = num + 5

4. num = 2 * num

5. num = num - 7

6. Print num

7. Stop

Explanation:

The first and the last line of the algorithm starts and ends the algorithm

Line 2 gets user input;

Assume user input is 9

num = 9

Line 3: adds 5 to the inputted number

num = 9 + 5 = 14

Line 4 doubles the result of line 3

num = 2 * 14 = 28

Line 5 subtracts 7 from the result of 4

num = 28 - 7 = 21

Line 6 prints the output to the screen

Hence, the output of the algorithm is 21 if the user input is 9

You might be interested in
Define inheritance. give an example
Nezavi [6.7K]
A class can be defined<span> using another class as a foundation. In object-oriented programming terminology, one class can </span>inherit<span> fi elds and methods from another. An object that inherits from another is called a subclass, and the object it inherits from is called a superclass. A subclass extends the superclass.</span>
3 0
3 years ago
Given a list ` = (x1 x2 . . . xn−1 xn), we define two rotations of the list: The left-rotation is (x2 . . . xn−1 xn x1) and, lik
aleksandrvk [35]

Explanation:

The below code has been written in C language

void rotateright(int list[], int n)

{

  int x = list[n-1]

  int i;

  for (i = n-1; i > 0; i--)

     list[i] = list[i-1];

  list[0] = x;

}

void rotateleft(int list[], int n)

{

  int x = list[0]

  int i;

  for (i = 1; i < n-1 ; i++)

     list[i] = list[i+1];

  list[n-1] = x;

}

int main()

{

   int list[] = {x1, x2, x3, ... x(n-1),xn}

   int i;

   int n = sizeof(list);

       

   rotateright(list, n);

 

   rotateleft(list, n);

   

   return 0;

}

3 0
3 years ago
(BRAINLIEST QUESTION!!!)
docker41 [41]

Answer:

Possible if hackers are not so intelligent.

Explanation:

Actually, hackers are intelligent

where they will change location code in different places every second. So end-user who is trying to trace it he or she has to use their intelligence to find the exact location of hackers.

Normally hackers will generate different location places and by using decipher it is possible to find the location codes.

Since hackers used encrypted message we need to decrypts the message and find it out and understand the decrypt and encrypt technology used by hackers.

It is possible to by using decipher to get uncovered locations

4 0
3 years ago
How the data is converted into the information?​
leonid [27]

Answer:

the data is converted into information by data processing

7 0
3 years ago
Read 2 more answers
Please debug the below code in Java please.
lisabon 2012 [21]

Answer:

Check the explanation

Explanation:

//Bugs are highlighted in bold text

class Invoice

Declarations

private num invoiceNumber

private string customer

private num balanceDue

private num tax

public void setInvoiceNUMBER(num number)

Declarations

num LOW_NUM = 1000

num HIGH_NUM = 9999

if number > HIGH_NUM then

invoiceNumber = 0

else

if number < LOW_NUM then

invoiceNumber = 0

else

invoiceNumber = num

endif

return

public void setCustomer(string cust)

customer = cust

return

public void setBalanceDue(num balance)

//Bug balanceDue is Invoice class varible

//but it is assigned to balance .it gives error

balance = balanceDue

setTax()

return

private void setTax()

Declarations

//Bug TAX_RATE is declared as string

//but assigned a double value

string TAX_RATE = 0.07

tax = tax * TAX_RATE

return

public void displayInvoice()

output "Invoice #", invoiceNumber

output "Customer: ", customer

output "Due: ", balanceDue

output "Tax: ", taxDue

//Bug

//Invoice class has no variable called balance .it should be balanceDue

output "Total ", balance + taxDue

return

endClass

start

Declarations

Invoice inv1

Invoice inv2

Invoice inv3

//Warning

//it gives warning object taken but not initilaized

Invoice inv4

inv1.setInvoiceNumber(1244)

inv1.setCustomer("Brown")

inv1.setBalanceDue(1000.00)

inv1.displayInvoice()

inv2.setInvoiceNumber(77777)

inv2.setCustomer("Jenkins")

inv2.setBalanceDue(2000.00)

inv2.displayInvoice()

inv3.setInvoiceNumber(888)

inv3.setCustomer("Russell")

inv3.setBalanceDue(3000.00)

//Bug

//setTax method of Invioce doesnot take any arguments

inv3.setTax(210.00)

inv3.displayInvoice()

stop

//Here is the complete program in c++

//Run the program using Microsoft visual studio 2010 vc++

#include<iostream>

#include<iomanip>

#include<string>

using namespace std;

class Invoice

{

//class varibales

private:

           int invoiceNumber;

           string customer;

           double balanceDue;

           double tax;

//class methods

public:

           void setCustomer(string cus);

           void displayInvoice();

           void setBalanceDue(double balance);

           void setInvoiceNUMBER(int number);

           void setTax();

};

void Invoice::displayInvoice()

{

cout<< setw(10)<<"Invoice #"<<setw(5)<<invoiceNumber<<endl;

cout<<setw(10)<<"Customer: "<<setw(5)<<customer<<endl;

cout<<setw(10)<<"Due: "<<setw(5)<<balanceDue<<endl;

cout<<setw(10)<<"Tax: "<<setw(5)<<tax<<endl;

//Bug

//Invoice class has no variable called balance .it should be balanceDue

cout<< "Total "<< balanceDue + tax<<endl;

}

void Invoice::setCustomer(string cust)

{

customer = cust;

}

void Invoice::setInvoiceNUMBER(int number)

{

const int LOW_NUM = 1000;

const int HIGH_NUM = 9999;

if( number > HIGH_NUM )

invoiceNumber = 0;

else

if (number < LOW_NUM )

       invoiceNumber = 0;

else

   invoiceNumber = number;

}

void Invoice::setBalanceDue(double balance)

{

balanceDue = balance;

}

void Invoice::setTax()

{

double TAX_RATE = 0.07;

tax = balanceDue * TAX_RATE;

}

int main()

{

Invoice inv1;

Invoice inv2;

Invoice inv3;

inv1.setInvoiceNUMBER(1244);

inv1.setCustomer("Brown");

inv1.setBalanceDue(1000.00);

inv1.setTax();

inv1.displayInvoice();

inv2.setInvoiceNUMBER(77777);

inv2.setCustomer("Jenkins");

inv2.setBalanceDue(2000.00);

inv2.setTax();

inv2.displayInvoice();

inv3.setInvoiceNUMBER(888);

inv3.setCustomer("Russell");

inv3.setBalanceDue(3000.00);

inv3.setTax();

inv3.displayInvoice();

system("pause");

return 0;

}

Kindly check the output image below.

5 0
3 years ago
Other questions:
  • Sarah is entering weekly sales data for week 37 of the current year; however, when she moves down to thecells where she needs to
    8·2 answers
  • Which style of leadership would be most helpful to Charles in the following situation? Charles has just started an internship at
    15·1 answer
  • Which of these BEST describes an inference?
    11·2 answers
  • Which of the following people was a member of FFA?
    7·1 answer
  • What is blogging
    15·2 answers
  • All of the following are aspects of the search process except?
    6·2 answers
  • . What type of computer implementation does the following code represent? Load A,10 Load B,1:5 Add A,B STORE A, [20]
    5·1 answer
  • Demographics refers to
    7·1 answer
  • What feature is available to add a suggestion in the margin of someone else's document?​
    15·1 answer
  • In addition to reduced power consumption, what is an advantage of using hyperscale cloud computing data centers?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!