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
oee [108]
3 years ago
11

I need help writing this pseudocode

Computers and Technology
1 answer:
Assoli18 [71]3 years ago
4 0

The flowchart gives most of the solution, you only have to translate the loop to something like a while() { ... } structure:

X=0

input num

while (num > 5) {

ouput num

X = X + num

num = num + 2

}

output X

If you run this with num = 8, it would print:

8

6

14

You might be interested in
A combination lock has the following basic properties:
fomenos

Answer:

public class CombinationLock {

   

    private int combinationNumber1 = 0;

    private int combinationNumber2 = 0;

    private int combinationNumber3 = 0;

   

   CombinationLock(int combinationNumber1, int combinationNumber2, int combinationNumber3){

       this.combinationNumber1 = combinationNumber1;

       this.combinationNumber2 = combinationNumber2;

       this.combinationNumber3 = combinationNumber3;

   }

   

   public boolean open(int number1, int number2, int number3){

       if(number1 == combinationNumber1 && number2 == combinationNumber2 && number3 == combinationNumber3)

           return true;

       else

           return false;

   }

   

   public boolean changeCombo(int number1, int number2, int number3, int newNumber1, int newNumber2, int newNumber3){

       

       if (open(number1, number2, number3)){

           combinationNumber1 = newNumber1;

           combinationNumber2 = newNumber2;

           combinationNumber3 = newNumber3;

           return true;

       }else

           return false;

   }

}

Explanation:

- <em>Three variables</em> are created to hold the combination.

- A <em>constructor</em> is created to set the combination.

- A boolean method called <em>open</em> is created to check if the given numbers are correct, and <u>returns true</u> (<u>otherwise returns false</u>).

- A boolean method method called <em>changeCombo</em> is created to check if given numbers are correct. If they are correct, it assigns new values for the combination and <u>returns true</u> (<u>otherwise returns false</u>).

5 0
2 years ago
Cascading style sheets (css) use special hypertext markup language (html) tags to globally define font characteristics for a var
ehidna [41]
The statement that Cascading style sheets (CSS) use special hypertext markup language (HTML) tags to globally define font characteristics for a variety of page elements as well as how those elements are laid out on a web page is true. <span> CSS is a stylesheet language used to describe the presentation of a document written in HTML or XML.</span>
5 0
3 years ago
The purpose of this assignment is to determine a set of test cases knowing only the function’s specifications, reported hereaf
Nesterboy [21]

Answer:

The program is written using PYTHON SCRIPT below;

N=int(input(" Enter number of Rows you want:"))

M=[] # this for storing the matrix

for i in range(N):

l=list(map(int,input("Enter the "+str(i+1)+" Row :").split()))

M.append(l)

print("The 2D Matrix is:\n")

for i in range(N):

print(end="\t")

print(M[i])

W=[] # to store the first non zero elemnt index

T=[] # to store that value is positive or negative

L=len(M[0])

for i in range(N):

for j in range(L):

if (M[i][j]==0):

continue

else:

W.append(j) # If the value is non zero append that postion to position list(W)

if(M[i][j]>0): #For checking it is positive or negative

T.append(+1)

else:

T.append(-1)

break

print()

print("The first Non Zero element List [W] : ",end="")

print(W)

print("Positive or Negative List [T] : ",end="")

print(T)

Explanation:

In order for the program to determine a set of test cases it takes in input of 2D matrix in an N numbet of rows.

It goes ahead to program and find the column index of the first non-zero value for each row in the matrix A, and also determines if that non-zero value is positive or negative. The If - Else conditions are met accordingly in running the program.

5 0
2 years ago
Subscribe to (Thicc sickqueen) and like 2 vids and the claim your prize
lara [203]

Answer:

done

Explanation:

5 0
3 years ago
It is ________ to pass an argument to a function that contains an individual array element, such as numbers[3].
Lapatulllka [165]

Answer:

The answer is "option B".

Explanation:

In the C++ programming language, it is legal to pass a parameter in the method that includes an individual array element. where an array is a collection of homogeneous (similar types of) elements. and other options are not correct that can be defined as:

  • In option, a Passing argument in a function is not illegal in c++.
  • In option c, It is recommended by the ANSI committee.
  • In option d, It is good for practice in coding.
5 0
3 years ago
Other questions:
  • You browsing internet and you realize that its not responding what do you do with out rebooting the computer
    10·1 answer
  • _ effects determine how slide elements disappear
    11·1 answer
  • In networking, bandwidth is the volume of computer data carried via a conductor in a period of time. Which one of these could be
    11·1 answer
  • 1. Consider a direct-mapped cache that can accommodate 8Mbytes from a main memory, that uses a 32-bit address and 32-byte blocks
    5·1 answer
  • Availability is an essential part of ________ security, and user behavior analysis and application analysis provide the data nee
    14·1 answer
  • Which type of computer graphic can be blown up to a much larger size without getting distorted or losing quality?
    5·1 answer
  • Term of The surroundings and conditions of your workplace
    6·1 answer
  • 4.2 lesson practice help plzs
    6·1 answer
  • A characteristic often associated with entrepreneurship is
    9·1 answer
  • You defined a class and saved it as shoe.py.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!