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
Oxana [17]
3 years ago
7

Given the integer variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another integer va

riable min.
Computers and Technology
1 answer:
Flura [38]3 years ago
3 0
You should specify what language you're using in these types of questions. Here's an example in C++, which is fairly easy to understand, so you should be able to transfer the concept to another language to problem.

int x = 2, y = 1, z = 3, min;

if (x < y && x < z)
min = x;
else if (y < x && y < z)
min = y;
else if (z < x && z < y)
min = z;
else
std::cout << "There is no minimum";
You might be interested in
def getCharacterForward(char, key): """ Given a character char, and an integer key, the function shifts char forward `key` steps
zhenek [66]

Answer:

  1. def getCharacterForward(char, key):  
  2.    charList = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  3.    if(len(char) > 1):
  4.        return None  
  5.    elif(not isinstance(key, int)):
  6.        return -1
  7.    else:
  8.        index = charList.find(char)
  9.        if(index + key <= 25):
  10.            return charList[index + key]
  11.        else:
  12.            return charList[(index + key)% 26]
  13. print(getCharacterForward("C", 4))
  14. print(getCharacterForward("X", 4))

Explanation:

Firstly, define a charList that includes all uppercase alphabets (Line 2). We presume this program will only handle uppercase characters.

Follow the question requirement and define necessary input validation such as checking if the char is a single character (Line 4). We can do the validation by checking if the length of the char is more than 1, if so, this is not a single character and should return None (Line 5). Next, validate the key by using isinstance function to see if this is an integer. If this is not an integer return -1 (Line 6 - 7).

Otherwise, the program will proceed to find the index of char in the charList using find method (Line 9). Next, we can add the key to index and use the result value to get forwarded character from the charList and return it as output (Line 11).

However, we need to deal a situation that the char is found at close end of the charList and the forward key steps will be out of range of alphabet list. For example the char is X and the key is 4, the four steps forward will result in out of range error. To handle this situation, we can move the last two forward steps from the starting point of the charList. So X move forward 4 will become B. We can implement this logic by having index + key modulus by 26 (Line 13).  

We can test the function will passing two sample set of arguments (Line 15 - 16) and we shall get the output as follows:

G

B

8 0
3 years ago
I really need help with this question, I can’t fail this please :) tysm
Maurinko [17]

Answer:

i think its the third one, i hope this helps

Explanation:

4 0
4 years ago
Cooper Technologies is a technology company that offers many IT services in Chicago. The company's services and products include
natima [27]

Answer: Broad needs and many customers.

Explanation:

Broad needs along with many customers is the strategic position technique in which customers are served with the service and product through a certain channel and ways.It is used for fulfilling the numerous needs of customers in a way that other competing companies cannot serve.

  • According to the question,Cooper technologies is using broad needs and many customers strategic positioning to serve its various customers with services like repair, computer training,tracking etc.
  • Thus, they are handling numerous needs of their many customers.
5 0
4 years ago
What was the name of first computer?
viva [34]
The ENIAC (Electronic Numerical Integrator and Computer) was the first electronic programmable computer built in the U.S. Although the ENIAC was similar to the Colossus, it was much faster, more flexible, and it was Turing-complete.
7 0
3 years ago
State three positive uses of the computer in the government sector​
WINSTONCH [101]

Well Here I got 4

1. Email Functions

2. Distributing Payments

3. Record Keeping

4. Direct Mail Promotions

<em>Have A great night!</em>

<em></em>

6 0
4 years ago
Other questions:
  • Which of the following is not true about managing your privacy settings? (select all that apply)
    9·2 answers
  • What will be displayed if code corresponding to the following pseudocode is executed? Set Number = 4 Repeat Write 2 * Number Set
    12·1 answer
  • Consider the following code snippet.a.File inputFile = new File("dataIn.txt");b.Scanner in = new Scanner(inputFile);c.while (in.
    7·1 answer
  • Which is more, 6 yards or 15 feet?​
    11·2 answers
  • Why isn't my brainly camera working? I got Brainly Plus and can't even scan questions. I've logged out, I've uninstalled and rei
    14·1 answer
  • Portfolio Activity: Writing a Résumé
    5·1 answer
  • When is 1600 plus 25 and 1700 minus 35 the same thing?​
    10·1 answer
  • who here plays overwatch or paladins ps4? I'm getting overwatch soon and need people to play with. please don't report this.​
    14·1 answer
  • can you imagine what life might have been like before the internet laptops and smartphones were part of everyday life what are s
    7·2 answers
  • Why should you keep lines of code short?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!