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
earnstyle [38]
3 years ago
10

What will be displayed after code corresponding to the following pseudocode is run? Main Set OldPrice = 100 Set SalePrice = 70 C

all BigSale(OldPrice, SalePrice) Write "A jacket that originally costs $ " + OldPrice Write "is on sale today for $ " + SalePrice End Program Subprogram BigSale(Cost, Sale As Ref) Set Sale = Cost * .80 Set Cost = Cost + 20 End Subprogram

Computers and Technology
1 answer:
Tatiana [17]3 years ago
7 0

Answer:

A jacket that originally costs $ 100 is on sale today for $ 80                                    

Explanation:

Main : From here the execution of the program begins

Set OldPrice = 100  -> This line assigns 100 to the OldPrice variable

Set SalePrice = 70   -> This line assigns 70to the SalePrice variable

Call BigSale(OldPrice, SalePrice)  -> This line calls BigSale method by passing OldPrice and SalePrice to that method

Write "A jacket that originally costs $ ", OldPrice  -> This line prints/displays the line: "A jacket that originally costs $ " with the resultant value in OldPrice variable that is 100

Write "is on sale today for $ ", SalePrice  -> This line prints/displays the line: "is on sale today for $ " with the resultant value in SalePrice variable that is 80

End Program -> the main program ends

Subprogram BigSale(Cost, Sale As Ref)  -> this is a definition of BigSale method which has two parameters i.e. Cost and Sale. Note that the Sale is declared as reference type

Set Sale = Cost * .80  -> This line multiplies the value of Cost with 0.80 and assigns the result to Sale variable

Set Cost = Cost + 20  -> This line adds 20 to the value of Cost  and assigns the result to Cost variable

End Subprogram  -> the method ends

This is the example of call by reference. So when the method BigSale is called in Main by reference by passing argument SalePrice to it, then this call copies the reference of SalePrice argument into formal parameter Sale. Inside BigSale method the reference &Sale is used to access actual argument i.e. SalePrice which is used in BigSale(OldPrice, SalePrice) call. So any changes made to value of Sale will affect the value of SalePrice

So when the method BigSale is called two arguments are passed to it OldPrice argument and SalePrice is passed by reference.

The value of OldPrice is 100 and SalePrice is 70

Now when method BigSale is called, the reference &Sale is used to access actual argument SalePrice = 70

In the body of this method there are two statements:

Sale = Cost * .80;

Cost = Cost + 20;

So when these statement execute:

Sale = 100 * 0.80 = 80

Cost = 100 + 20 = 120

Any changes made to value of Sale will affect the value of SalePrice as it is passed by reference. So when the Write "A jacket that originally costs $ " + OldPrice Write "is on sale today for $ " + SalePrice statement executes, the value of OldPrice remains 100 same as it does not affect this passed argument, but SalePrice was passed by reference so the changes made to &Sale by statement in method BigSale i.e.  Sale = Cost * .80; has changed the value of SalePrice from 70 to 80 because Sale = 100 * 0.80 = 80. So the output produced is:

A jacket that originally costs $ 100 is on sale today for $ 80                              

You might be interested in
Noah would like to center and underline the title. Which of the following steps should Noah follow?
Tresset [83]

Answer:

Option 3 - Type the title, highlight the text, select the underline command, and select the centering command.

6 0
3 years ago
What?<br> I couldn't hear you.<br> (play along)
nexus9112 [7]

Answer:

no

Explanation:

5 0
3 years ago
"The ______ code of a rootkit gets the rootkit installation started and can be activated by clicking on a link to a malicious We
makkiz [27]

Answer:

Dropper.

Explanation:

A rootkit can be defined as a collection of hidden malicious computer software applications that gives a hacker, attacker or threat actor unauthorized access to parts of a computer and installed software. Some examples of rootkits are trojan, virus, worm etc.

The dropper code of a rootkit gets the rootkit installation started and can be activated by clicking on a link to a malicious website in an email or opening an infected PDF file such as phishing.

Hence, the dropper code of a rootkit launches and installs the loader program and eventually deletes itself, so it becomes hidden and not be noticed by the owner of the computer.

A rootkit can affect the performance of a computer negatively causing it to run slowly.

3 0
3 years ago
Which of these number formats would you want to apply to a cell showing the total sales for the month? Currency, Number, or Perc
ollegr [7]

Answer:

Currency

Explanation:

Since sales are in money, and currency shows money, Currency is our answer

3 0
3 years ago
Read 2 more answers
Complete the statement below with the correct term. A a0 network uses cables to connect the server to workstations and other equ
Korolek [52]

Answer:

<h3> A <u>wired</u> network uses cables to connect the server to workstations and other equipment. </h3><h3 />

Explanation:

A computer network is defined as a collection of computers connected together to share resources and for communication these resources could be internet, printer, or a file server.

A wired network is a type of network in which we use to connect to other devices or resources via a wired connection this wire could be a Ethernet, Fiber or Coaxial cable which work as a medium for the network. For network we use different devices like routers, switches and many more according to requirements.

<h3>I hope it will help you!</h3>
5 0
3 years ago
Other questions:
  • Windows server 2012 r2 includes hyper-v in which edition(s)?
    12·1 answer
  • Where does most of the work in creating a presentation will take place? Either formatting toolbar, normal (Slide) view, slide so
    12·2 answers
  • Public class Robot
    15·1 answer
  • NO BODY KNOWS! How old is Cynthia Blaise!?
    7·1 answer
  • Write a Bare Bones program that takes as input two variables X and Y. (Again, assume these values are set before your program be
    10·2 answers
  • Write a recursive function to determine if a number is prime.
    8·1 answer
  • Which of the following is not a characteristic of Web 2.0?
    14·1 answer
  • Question #1
    8·2 answers
  • Chloe is not pleased with how four images that she has placed on a web page relate to each other. Which search string will be mo
    5·1 answer
  • Help this toddler┐(´ー`)┌​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!