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
juin [17]
2 years ago
6

Write a program that has two variables, start and end which represent beginning and end of segment, including start and end, whi

ch calculates all elements from that segment that are divisible by 3 but not by 6.
Can someone help me with this?
​
Computers and Technology
1 answer:
mr_godi [17]2 years ago
4 0

The program illustrates the concepts of loops and conditional statements.

<h3>The complete program</h3>

The program written in Python, where comments are used to explain each line is as follows:

start = int(input())

end = int(input())

for i in range(start, end+1):

    if i%3 == 0 and i % 6 !=0:

         print(i,end = " ")

Read more about python programs at:

brainly.com/question/13246781

#SPJ1

You might be interested in
. Database connectivity software is also known as:
astra-53 [7]

Answer: Database middleware

Explanation:

   Database connectivity is the technique by which application programs makes the interaction and transfer of data storage . The connectivity of the database of the software is called database middleware, as it acts as a piece of software that makes connection as a middle-factor between the application program and the collection of data.

Therefore, database connectivity is also called as database middleware.  

5 0
3 years ago
Write a program to input money in cents from user, example 12745 and display the one dollar bills and the cents. Submit source c
ira [324]

import java.util.*;  //This is used to import the Scanner

class Main {

 public static void main(String[] args) {

   System.out.println("Hello world!");

   Scanner ValCents = new Scanner (System.in);

   System.out.println("Enter Number:");

   int user_input = ValCents.nextInt();

   int result = user_input/100;  // This one will solve for the one dollar bills.

   int remain = user_input % 100;  // This one will get the remainder of cents.

   System.out.println(result + " One Dollar Bills");

   System.out.println(remain + " Cents");

 }

}

Remember that you need to get the amount of dollar bills separately from the number of cents. This is because the int variable will always return the whole value of the number. The modulo is used to get the variable of the cents as the whole number is already taken by the "result".

6 0
3 years ago
Consider the following recursive method, which is intended to return a String with any consecutive duplicate characters removed.
saul85 [17]

Answer:

D. return str.substring(0, 1) + removeDupChars(str.substring(1));

Explanation:

The logic here is following:

If the there are consecutive duplicate characters, return the removeDupChars method. The parameter of the removeDupChars method is a string, but the duplicate of the first character is removed from the string. The else-if part of the program does this job.

If the consecutive characters are not duplicated, return the first character of the string and the removeDupChars method. The parameter of the removeDupChars method is the rest of the string characters. The else part of the program does this job.

When the length of the str becomes one (or when the str is null), the program reaches its base and returns the str. The if part of the program does this job.

4 0
3 years ago
12. In Justify the text is aligned both to the right and to the left margins, adding extra space between words as necessary *
Lena [83]

\blue{

\green{

Answer:

  • False

Explanation:

  • Because, aligment the tex are aligned in the centre of the page.

\pink{

\red{

4 0
2 years ago
Read 2 more answers
Modify an array's elements Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples t
ValentinkaMS [17]

Answer:

See explaination for program code

Explanation:

%save as AdjustMinValue.m

%Matlab function that takes three arguments

%called number of samples count, user samples

%and min vlaue and then returns a data samples

%that contains values which are double of usersamples

%that less than min vlaue

%

function dataSamples=AdjustMinValue(numberSamples, userSamples, minValue)

dataSamples=userSamples;

%for loop

for i=1:numberSamples

%checking if dataSamples value at index,i

%is less than minValue

if dataSamples(i)<minValue

%set double of dataSamples value

dataSamples(i)= 2*dataSamples(i);

end

end

end

Sample output:

Note:

File name and calling method name must be same

--> AdjustMinValue(4, [2,12,9,20],10)

ans =

4 12 18 20

3 0
3 years ago
Other questions:
  • The PATH environment variable.
    5·1 answer
  • HELP 10 POINTS AND BRAINLIEST FOR BEST ANSWER! EASY I PROMISE! HELPFUL ANSWERS ONLY PLEASE HURRY!
    14·2 answers
  • Match each task with the features necessary to complete the task
    10·1 answer
  • How can you autohide the taskbar in Windows 10?
    8·2 answers
  • How can i turn on my prinfer without getting up
    12·2 answers
  • Which of these is an aggregator?
    9·2 answers
  • Ann needs to share information about a new hiring policy. She needs to communicate this information to more than one hundred emp
    15·2 answers
  • Organizing speech ideas according to physical space, direction, or location calls for a _____ organizational pattern.
    11·1 answer
  • How do I get the pictures from my old Samsung phone to put on my iPhone? The Samsung is turned off. Is there a way to transfer i
    8·1 answer
  • What is not recyclable in a<br> hybrid car<br> hydrogen car<br> petrol car
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!