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
Sedaia [141]
3 years ago
6

Write a bash script HW4p2.sh to print out the list of numbers between 0 to 100 (including 0 and 100) that are divisible by both

3 and 5. You must create a bash function inside the script to check the divisibility by 3 and 5.
Computers and Technology
1 answer:
ratelena [41]3 years ago
8 0

Answer:

#!/bin/bash

function number_div( ) {

   for i in {0. .100};

   do

   if (( $i % 3 == 0 ))

   then

   echo $i

   elif (( $i % 5 == 0 ))

   then

   echo $i

   else

   echo "Number not divisible by 3 and 5"

   fi;

   done

}

number_div( )

Explanation:

The bash script is saved as "HW4p2.sh" and executed as "./HW4p2.sh". This code would print all and only numbers divisible by 3 or 5.

You might be interested in
Whenever I try to take a picture of a question on brainly it says “oops something went wrong try again in a while”. Is anybody h
yuradex [85]

Answer:

yes I am having the same problem I take a picture and it says something is wrong with connection

8 0
3 years ago
Read 2 more answers
____ are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various
gregori [183]

Answer:

E. Genetic algorithms

Explanation:

In Computer science, Genetic algorithms are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various mathematical models, and comparing the mutated models to search for a best alternative.

6 0
2 years ago
Consider the following class definitions. public class BClass { private int x; public void set(int a) { x = a; } public void pri
Feliz [49]

Answer:

Option (ii) is the correct option to the following code.

Explanation:

In the following code of the Java Programming Language, there is two print function after the set function then, we firstly set the value of x and print it through print function which is already declared then, we set the value of y through set function then, print the value of y through print function. So, that's why the following option is correct.

4 0
3 years ago
Write a function named "sum_values" that takes a list as a parameter and returns the sum of the values at indices 9, 8, and 11.
Svet_ta [14]

Answer:

def sum_values(mylist):

 sumSomeNumbers = mylist[9]+mylist[8]+mylist[11]

 print(sumSomeNumbers)

Explanation:

Using python programming language;

A function is created called sum_values that accepts one parameter

Withing the function body, a variable called sumSomeNumbers is created to hold the sum of the elements at index 9,8 and 11

Finally a print Statement is used to output sumSomeNumbers

When the function is called It is passed a list as argument and it will display the sum of the three numbers at that indices

for example:

lst = [23,3,4,5,6,63,2,3,5,6,5,5,7,89]

sum_values(lst)

Outputs 16

3 0
3 years ago
I'm taking a class on how to make a movie, and it offers some apps that would be helpful in the process. The thing is, I don't h
Marat540 [252]

you could use an app called cutecut ! perfect for editing videos or to make a movie!!

3 0
2 years ago
Read 2 more answers
Other questions:
  • If you are making a 30-minute presentation, how much time should be spent summarizing your points and making any closing remarks
    11·2 answers
  • what is the best book or website to learn mechanical machine design? . high detail ,easy to under stand .
    15·1 answer
  • You manage a server that users store their document files on. you are finding that some users are utilizing more space than they
    14·1 answer
  • Discuss whether the redundant data should be addressed prior to beginning the wireless network architecture project, in coordina
    11·1 answer
  • An administrator needs to set up an authentication server for users connecting to a network through a VPN. What kind of server c
    12·1 answer
  • Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user wil
    13·1 answer
  • Can you give an example of mail merge (letter) pls​​
    6·1 answer
  • Which image file format is the best format to use for photographs on the Web
    15·1 answer
  • Which of the following restricts the ability for individuals to reveal information present in some part of the database?
    11·1 answer
  • What is meant by byte in computer terminology​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!