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
Aleks [24]
3 years ago
15

Create a function (prob3_6) that will do the following: Input a positive scalar integer x. If x is odd, multiply it by 3 and add

1. If the given x is even, divide it by 2. Repeat this rule on the new value until you get 1, if ever. Your program will output how many operations it had to perform to get to 1 and the largest number along the way.
Computers and Technology
1 answer:
aniked [119]3 years ago
5 0

Answer:

Following are the program in python language

def prob3_6(k): #function definition

  c = 0 #variable declaration

  while k != 1: #iterating the while loop

      print(k) #print k

      if k % 2 == 0:#check if condition  

          k= k // 2 #divisible by 2

      else: #else condition

          k = k * 3 + 1  

      c = c + 1

  print(k) #print k

  print c #print count

prob3_6(3)#function call

Output:

3

10

5

16

8

4

2

1

7

Explanation:

Following are the description of program

  • Create a function "prob3_6" in this function we passing an integer parameter of type "int" named "k".
  • Inside that function we declared a variable "c" of type "int" that is used for counting purpose .
  • After that we iterated the while for print the value of when it is not equal to 1 .
  • We check if condition when k gives 0 on modulus then k is divisible by 2 otherwise else block will be executed in the else part we multiply by 3 to k and add 1 to the k variable .
  • Finally print "k" and "c"

You might be interested in
Differences between laptop andhandheld conputer​
sveticcg [70]

Answer: a conputer has a moniter and a mouse and laptop doesn't

Explanation:

6 0
3 years ago
During the installation of Windows Server 2019 Standard Edition, you encounter a disk that is marked as Disk 0 Unallocated Space
sp2606 [1]

There are different kinds of system software.  What should you do to complete the installation on this disk is to Create a new partition and then perform the installation

<h3>How are Hands-On Projects done?</h3>

This kind of project are often  completed in the right order that they were given and it often take about three hours or less to complete it in general. This projects needs:

• A system that has Windows Server 2019 that is said to be already installed based on  Hands-On Project 1-1/1-2.

• A Windows Server 2019VM2 virtual machine  also installed based  on Hands-On Project 3-5.

Note that when one wants to install an operating system, one has to  drive or make partition available so as to copy all the files..

During the installation of Windows Server 2019 Standard Edition, you encounter a disk that is marked as Disk 0 Unallocated Space on the Windows Setup wizard.

What should you do to complete the installation on this disk?

Create a new partition and then perform the installation

Load the device drivers for the Disk

Click Next to proceed with the installation

Format the disk using the Format option

Learn more about Windows Server from

brainly.com/question/25554117

6 0
2 years ago
Please list 15 safety rules that you think should be practiced in the Computer Technology classroom/lab.
nikklg [1K]

Answer:BE RESPECTFUL! Always treat the computer lab equipment AND your teacher and classmates the way that you would want your belongings and yourself to be treated.

No food or drinks near the computers. NO EXCEPTIONS.

Enter the computer lab quietly and work quietly. There are other groups and individuals who may be using the computer lab. Please be respectful.

Surf safely! Only visit assigned websites. Some web links can contain viruses or malware. Others may contain inapropriate content. If you are not certain that a website is SAFE, please ask a teacher or other adult.

Clean up your work area before you leave. All cords should be placed on the tables (not hanging off the sides). Headphones should be placed on the CPU/tower or monitor. Chair should be pushed under the tables. All trash, papers, and pencils should be picked up.

Do not change computer settings or backgrounds.

Ask permission before you print.

SAVE all unfinished work to a cloud drive or jump drive. Any work that is saved to the computer will be deleted when the computer is powered off or updated at the end of the day.

If you are the last class of the day, please POWER DOWN all computers and monitors.

Keep your files organized

Don’t let a student’s desktop become the digital version of his hectic book bag. Set aside a few minutes at the beginning or end of working on an assignment to ensure that students are saving unfinished work somewhere that they will be able to find it next time.

Log off

Logging off is like the digital version of cleaning up after yourself in the classroom. Students need to leave the computer ready for the next user. Logging off is also important to make sure that student work and accounts stay private.

Each person may only use one computer at a time

Computers and peripherals are not to be moved or reconfigured without approval of Lab and Classrooms staff.

Behavior and activities that disturb other users or disrupt the operations of the lab are not allowed. This includes, but is not limited to: physical activities such as "rough-housing," loud music, etc.

Children are only allowed in computer labs if they are well-behaved and supervised at all times. Children may not use the computers or occupy workstation areas. At no time are children to be left unattended.

.Explanation:

sorry about only 9 rules

4 0
3 years ago
Use the nutrition label to determine how many calories would be consumed by drinking 1 liter of Mountain Dew.
Rus_ich [418]
1 liter of mountain dew is 170 calories
4 0
3 years ago
Read 2 more answers
What peripheral displays us the image on a computer?​
zhenek [66]

Answer:

The monitor. It can be a CRT,LCD or LED monitors

Explanation:

Hope it helps

6 0
3 years ago
Other questions:
  • An Information Technology worker who follows the Programming and Software development pathway most likely enjoys
    15·2 answers
  • A step commonly used for Internet vulnerability assessment includes __________, which occurs when the penetration test engine is
    9·1 answer
  • Like this post if u hate edhesive
    6·1 answer
  • Which of the following would indicate that a website is a secure site?
    7·2 answers
  • A new protocol for new information distribution proposed by CERN became the world wide wed in 1991.
    10·1 answer
  • Which description best explains a placeholder?
    7·1 answer
  • Which level of education do most peoplebecoming a broadcast analyst obtain?
    13·2 answers
  • ACL 1 has three statements, in the following order, with address and wildcard mask values as follows: 1.0.0.0 0.255.255.255, 1.1
    6·1 answer
  • Linux applications are developed using ________ programming language.
    7·1 answer
  • Your computer monitor’s power switch is in the ‘ON’ position; however, the display is blank. Which of the following is NOT a lik
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!