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
vodomira [7]
3 years ago
13

Write a function in Java to implement the following logic:

Computers and Technology
1 answer:
galben [10]3 years ago
8 0

Answer:

Explanation:

The following Java code basically divides the goal size by 5 and rounds the answer to the lowest whole number. Then multiplies that answer by 5 and goes adding 1 until the exact goal size is met. If the value is passed then that means that using the current brick sizes it is not possible to make the goal. Otherwise, it will print out that it is possible.

import java.io.*;

import java.util.Scanner;

public class Main{

       public static void main(String args[]) throws IOException {

               String answer = "No, it is not possible";

               Scanner in = new Scanner(System.in);

               System.out.println("Enter goal size: ");

               float goalSize = in.nextFloat();

               float currentSize = (float) Math.floor(goalSize / 5);

               currentSize = currentSize * 5;

               while (true) {

                       if (currentSize < goalSize) {

                               currentSize += 1;

                       } else if(currentSize == goalSize) {

                               answer = "Yes, it is possible";

                               break;

                       } else {

                               break;

                       }

               }

               System.out.println(answer);

       }

You might be interested in
Which of the following terms refers to the cells that contain values and labels to be graphed in the chart?.
quester [9]

There are cells in some charts. The terms that refers to the cells that contain values and labels to be graphed in the chart is source data.

<h3>What is the meaning of source data?</h3>

Source data is known to be a kind of raw data that is often known as an atomic data. They are data that has not been processed for any vital use to become Information.

In computer programming tech., source data or data source is known to be a kind of primary point or location from where data originates from. The data source is known as a database, a dataset, etc.

Learn more about source data from

brainly.com/question/10838478?source=archive

7 0
2 years ago
A cloud file system (CFS) allows users or applications to directly manipulate files that reside on the cloud.
Mademuasel [1]

Answer:

True is the correct answer for the above question.

Explanation:

A CFS(cloud file system) is used to create a spoke and hub method for the data distribution in which hub is a storage area situated on the central part of the cloud system. It is located in a public cloud provider like AWS.

It uses to manipulate the file for the purpose of data distribution so that it can store the file on the cloud easily with the available some spaces only.

It provides access to the user that they can manipulate the file for their needs if the files are available on the cloud.

The question scenario also states the same which is described above hence It is a true statement.

5 0
2 years ago
. If you have written the following source code:
taurus [48]

Answer:

SpringBreak.java

Explanation:

Java classes are saved in files having the same name as the class name.

So if the given class structure is:

public class SpringBreak{

// lots of code here

}

It needs to be saved in a file called SpringBreak.java.

The physical file should follow the package structure as provided in the class.

The java file will be compiled by the java compiler to generate the corresponding class file.

8 0
3 years ago
Hey does anybody know how to delete history on a school-issued chrome book, I tried to delete it but it won't let you clear your
satela [25.4K]

Answer:

You have to log in to your google account. BRAINLIEST PLEASE

Explanation:

5 0
3 years ago
(PYTHON) Write a program that uses this technique to read a CSV file such as the one given above. Display the IDs and names of t
Ludmilka [50]

Answer:

import csv

with open('employee_birthday.txt') as csv_file:

csv_reader = csv.reader(csv_file, delimiter=',')

line_count = 0

for row in csv_reader:

if line_count == 0:

print(f'Column names are {", ".join(row)}')

line_count += 1

else:

print(f'\t{row[0]} works in the {row[1]} department, and was born in {row[2]}.')

line_count += 1

print(f'Processed {line_count} lines.')

Explanation:

Heres an example of how to read csvs

7 0
3 years ago
Other questions:
  • Suppose that cells B1 through B100 of an Excel spreadsheet contain the quantity of units ordered on each of 100 different days.
    13·1 answer
  • You are able to change the formatting of a table after it is inserted into a placeholder. True or false
    9·2 answers
  • It is essential that a security professional is able to resolve and respond to cyber law inquiries and incidents while avoiding
    14·1 answer
  • Discus the pros and cons of Internal cloud service and External cloud service for both Infrastructure as a service and Applicati
    11·1 answer
  • Hey, how is everyone????????????????????????????????
    8·2 answers
  • PLZZZZZZZZZZZZZZZ HELP ME OUT!!!!! I SICK AND TIRED OF PEOPLE SKIPING MYQUESTION WHICH IS DUE TODAY!!!!
    14·1 answer
  • Why is it important for organizations to make strong commitment to Cloud at scale?
    14·1 answer
  • Define a python functions that draw a pinwheel using the pinwheel function that has input paramiters that allows you to change t
    15·1 answer
  • Integrity! He talks to me of integrity! I described a circle in the air. I'd tried to build my integrity upon the role of Brothe
    12·1 answer
  • Select the skill that matches the following definition.​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!