Modify the CountByFives application so that the user enters the value to count by. Start each new line after 10 values have been displayed.
public class CountByAnything
{
// Modify the code below
public static void main (String args[])
{
final int START = 5;
final int STOP = 500;
final int NUMBER_PER_LINE = 50;
for(int i = START; i <= STOP; i += START)
{
System.out.print(i + " ");
if(i % NUMBER_PER_LINE == 0)
System.out.println();
}
}
}

Answers

Answer 1

Answer:

The modified program is as follows:

import java.util.*;

public class CountByAnything{  

public static void main (String args[]){

   Scanner input = new Scanner(System.in);

final int START = 5;

final int STOP = 500;

int countBy; int count = 0;

System.out.print("Count By: ");

countBy = input.nextInt();

final int NUMBER_PER_LINE = 10;

for(int i = START; i <= STOP; i += countBy){

System.out.print(i + " ");

count++;

if(count == NUMBER_PER_LINE){

System.out.println();

count = 0;} } } }

Explanation:

To solve this, we introduce two variables

(1) countBy --> This gets the difference between each value (instead of constant 5, as it is in the program)

(2) count --> This counts the numbers displayed on each line

The explanation is as follows:

final int START = 5;

final int STOP = 500;

This declares countBy and count. count is also initialized to 0

int countBy; int count = 0;

This prompts the user for countBy

System.out.print("Count By: ");

This gets value for countBy

countBy = input.nextInt();

final int NUMBER_PER_LINE = 10;

This iterates through START to STOP with an increment of countBy in between two consecutive values

for(int i = START; i <= STOP; i += countBy){

This prints each number

System.out.print(i + " ");

This counts the numbers on each line

count++;

If the count is 10

if(count == NUMBER_PER_LINE){

This prints a new line

System.out.println();

And then set count to 0

count = 0;}


Related Questions

Can you help me in this question

Answers

Answer:

count = arry[0];

          for (i = 0; i < n; i++)

          {

              if (count>5);

              {

                  count;

              }

          }

       

       cout << "Total Count of the numbers greater than or equal to 5 : " <<count ;

Explanation:

count = arry[0];

          for (i = 0; i < n; i++)

          {

              if (count>5);

              {

                  count;

              }

          }

       

       cout << "Total Count of the numbers greater than or equal to 5 : " <<count ;

You are configuring NIC teaming on a server with two network adapters. You chose Switch Independent Mode. You now must choose between the two modes determining if one adapter is left offline or both adapters are functional. You require a mode for the highest throughput. What mode do you choose?

Answers

Answer:

The appropriate answer is "Active/Active mode".

Explanation:

Now just after the customers or clients respond to the traditional standards, the board is comprised the information rapport with the cloud service, which would be considered as Active mode.The car glides primarily somewhere at a specified constantly controlled rate of the conductor. Currently entering the grounding connection boosts the flow of electrons further into the receiver as well as the transmitter.

Thus the above is the correct solution.

Discuss five processes for analyzing a qualitative study

Answers

1. Prepare and organize your data.

Print out your transcripts, gather your notes, documents, or other materials. Mark the source, any demographics you may have collected, or any other information that will help you analyze your data.

2. Review and explore the data.

This will require you to read your data, probably several times, to get a sense of what it contains. You may want to keep notes about your thoughts, ideas, or any questions you have.

3. Create initial codes.

Use highlighters, notes in the margins, sticky pads, concept maps, or anything else that helps you to connect with your data. See the attached document that demonstrates how one might highlight key words and phrases as well as make notes in the margins to categorize the data:

4. Review those codes and revise or combine into themes.

Identify recurring themes, language, opinions, and beliefs.

5. Present themes in a cohesive manner.

Consider your audience, the purpose of the study, and what content should be included to best tell the story of your data.

Hope this helped you!!!

Answer:

Prepare and organize your data. Print out your transcripts, gather your notes, documents, or other materials.

Review and explore the data.

Create initial codes.

Review those codes and revise or combine into themes.

Present themes in a cohesive manner.

What term refers the built-in redundancy of an application's components and the ability of the application to remain operational even if some of its components fail

Answers

Answer:

Fault tolerance.

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer on how to perform a specific task and solve a particular problem.

Simply stated, it's a computer program or application that comprises of sets of code for performing specific tasks on the system.

Fault tolerance is an ability of the component of a software application or network to recover after any type of failure. Thus, it is the redundancy of an application's components built-in by default and the ability of this software application to remain functional or operational even if some of its components fail or it encounter some code blocks.

Basically, fault tolerance makes it possible for a software application or program to continue with its normal operations or functions regardless of the presence of hardware or system component failure.

Hence, it is an important requirement for any software application that should be incorporated by software developers during the coding stage of the software development life cycle (SDLC).

Write a Prolog predicate makeset(L1, L2) that takes list L1 of integers and removes the repeating elements. The result is returned in list L2. For example, makeset([1,3,4,1,3,9],Set). would return [1,3,4,9].

Answers

Answer and Explanation:

Using Javascript:

We could just use ES6 syntax and quickly get our result with no long coding. ECMA script 2015, the sixth version of javascript programming language has an array method that returns the unique values of an array in a new array.

var allValues = [ 1,3,4,1,3,9 ];

let uniqueValues = [...new Set(allValues)];

console.log(uniqueValues);

This will output only the unique values 1,3,4,9

With the GIS moving into the cloud, developers of enterprise applications based on SAP, Microsoft Office, SharePoint, MicroStrategy, IBM Cognos, and Microsoft Dynamics CRM are not using it to create a wide range of mobile applications.
a. True
b. False

Answers

Answer:

):

Explanation:

Calculate the total capacity of a disk with 2 platters, 10,000 tracks, an average of
400 sectors per track, and 512 bytes per sector?

Answers

Answer:

[tex]Capacity = 2.048GB[/tex]

Explanation:

Given

[tex]Tracks = 10000[/tex]

[tex]Sectors/Track = 400[/tex]

[tex]Bytes/Sector = 512[/tex]

[tex]Platter =2[/tex]

Required

The capacity

First, calculate the number of Byte/Tract

[tex]Byte/Track = Sectors/Track * Bytes/sector[/tex]

[tex]Byte/Track = 400 * 512[/tex]

[tex]Byte/Track= 204800[/tex]

Calculate the number of capacity

[tex]Capacity = Byte/Track * Track[/tex]

[tex]Capacity= 204800 * 10000[/tex]

[tex]Capacity= 2048000000[/tex]  --- bytes

Convert to gigabyte

[tex]Capacity = 2.048GB[/tex]

Notice that the number of platters is not considered because 10000 represents the number of tracks in both platters

Number are stored and transmitted inside a computer in the form of​

Answers

Number are stored and transmitted inside a computer in the form of ASCII code

What is the primary difference between BMPs, JPEGs, and GIFs?

Answers

In simple words,
JPEGs- Images
GIFs- animated images used for messaging

In the properly way to explain,
BMPs- The BMP file format, also known as bitmap image file, device independent bitmap (DIB) file format and bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device (such as a graphics adapter), especially on Microsoft Windows and OS/2 operating systems.

Answer:

BMPs are not compressed; JPEGs and GIFs are compressedExplanation:

What is the page table mainly for?

Answers

Answer: See explanation

Explanation:

A page table is used for the tracking and the location of different pages of a task in memory. It helps in showing the mapping of locations between the physical addresses and the virtual addresses.

A page table stores also has the page table entries and this is where the frame numbers are stored as well as the operational status.

quá trình xử lý dữ liệu (OSI) bên máy gởi, nhận có vẽ hình minh họa

Answers

Answer:

haywood is and best president for you me ravi in the a for and have to the a and should you of lost

what is SEO and SEM?

Answers

Answer:

SEO stands for “search engine optimization.” In simple terms, it means the process of improving your site to increase its visibility for relevant searches.

SEM, or search engine marketing, is the act of using paid strategies to increase search visibility.

QUESTION 2
1 poin
A document contains a list of items that appear in no particular order. Which of the following is the best way to format the list?

Answers

Answer:

Group of answer choices.

A. Apply numbering to the list.

B. Apply bullets to the list.

C. Apply multilevel numbering to the list.

D. Manually enter a ">" character at the beginning of each item in the list.

Answer:

B. Apply bullets to the list.

Explanation:

Formatting is a feature found in a lot of word processing software applications such as Microsoft Word, Notepad, etc., which is designed to avail end users the ability to apply specific formatting options such as cut, bold, italics, underline, list, etc., to texts based on certain criteria defined by an end user.

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users type, format and save text-based documents.

In Microsoft Word, a list can be formatted using a numbered or bulleted arrangement style. A numbered style (1, 2, 3, 4, etc) is typically used for an ordered list while a bullet is designed to be used for an unordered list.

Hence, the best way to format a document containing a list of items that appear in no particular order is to apply bullets to the list.

For example, a bulleted list of my favorite subjects arranged in no particular order would appear as this;

English language

Mathematics

Geography

Biology

Chemistry

Physics

Computer technology

What aspect should you consider before adding pictures to a document?

You should structure the BLANK first before you search for a relevant picture.

Answers

Answer:

You should structure the text first before you search for a relevant picture.

Explanation:

When adding a picture or pictures to a text document, the structure of the text must be considered.

Structure as used in the above sentence means (but is not limited to), the headings, the layouts, the spacing, paragraphs and word formatting in the document.

In other words, the way the document is organized

All these must be put in to place before one adds pictures into the document.

Calculate the boiling point of 3.42 m solution of ethylene glycol, C2H602, in water (Kb =0.51°C/m, the normal boiling point of water is 100°C):​

Answers

Answer:

128.10 degree Celsius

Explanation:

The boiling point is given by

[tex]T_b = \frac{1000*K_b * w}{M*W}[/tex]

Substituting the given values, we get -

[tex]T_b = \frac{1000*0.51 * 3.42}{62.07}\\T_b = 28.10[/tex]

Tb is the change in temperature

T2 -T1 = 28.10

T2 = 28.10 +100

T2 = 128.10 degree Celsius

What is the IP address and TCP port number used by the client computer (source) that is transferring the file to gaia.cs.umass.edu

Answers

Answer:

Explanation:

ae

At one college, the tuition for a full-time student is $6,000 per semester. It has been announced that the tuition will increase by 2 percent each year for the next five years. Design a program with a loop that displays the projected semester tuition amount for the next five years.

Answers

Answer:grhgrt

Explanation:

The program is an illustration of loops;

Loops are program statements used to perform repetition

The tuition program

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

#This initializes the fee

fee = 6000

#The following loop is repeated 5 times

for i in range(5):

   #This calculates the fee, each year

   fee *= 1.02

   #This prints the calculated fee

   print(round(fee,2),end=" ")

Read more about loops at:

https://brainly.com/question/24833629

#SPJ6

Explain the steps that are needed to remove the data items from linked list

Answers

Explanation:

Iterative Method:

To delete a node from the linked list, we need to do the following steps.

1) Find the previous node of the node to be deleted.

2) Change the next of the previous node.

3) Free memory for the node to be deleted.

Scenario: The Development group in a company wants to setup theirown Child Domain to have full control on managing their accounts and policies. The Main IT group is recommending they are setup with an Organizational Unit, and delegating the appropriate access.Make your case supporting either the Development group or the Main IT group.Computer ScienceEngineering & TechnologyNetworkingIFT 220

Answers

Answer:

(:

Explanation:

The Self-Quiz gives you an opportunity to self-assess your knowledge of what you have learned so far.

a. True
b. False

Answers

Answer:

a. True

Explanation:

A test can be defined as an examination or quiz given to a student (pupil) during an academic calendar in order to measure or determine his or her intelligence. It is usually graded based on a set of defined grades or scores.

The key characteristics of a well-designed test includes the following;

I. Standardization: it is important that test is set based on certain criteria and acceptable rules within the education community and curriculum.

II. Reliability: the questions contained in a test should be credible and backed by correct answers.

III. Validity: the test questions should be genuine and authentic across board.

Basically, a Self-Quiz is a form of test which is aimed at assessing or measuring the knowledge of a self quiz taker (user) such as a student or pupil.

This ultimately implies that, Self-Quiz avail an end users the opportunity to self-assess his or her knowledge of what he or she might have learned over a specific period of time.

However, any result or score obtained through a Self-Quiz count for nothing with respect to final grade or gaining admission into the university.

In the future, will training
and education become
more or less desirable?

Answers

To young children and students it'll be less desirable as they just want to play, I mean this is a natural characteristic of children so there's nothing to blame on them, but to young adults like college students and also parents, it's likely to be more desirable as they want their children to have a bright future through studying hard and landing themselves in good jobs. however, to some parents they might find it less desirable as they do not want their children to have pressure or and form of stress since it might still be the strawberry generation in the future.

Lesssssssssssssssssss

A ___________ consists of a large number of network servers used for the storage, processing, management, distribution, and archiving of data, systems, web traffic, services, and enterprise applications.

Answers

Answer:

Data center

Explanation:

A network service provider can be defined as a business firm or company that is saddled with the responsibility of leasing or selling bandwidth, internet services, infrastructure such as cable lines to both large and small internet service providers.

Generally, all network service providers, internet service providers and most business organizations have a dedicated building or space which comprises of a large number of computer systems, security devices, network servers, switches, routers, storage systems, firewalls, and other network associated devices (components) typically used for remote storage, processing, management, distribution, and archiving of large amount of data, systems, web traffic, services, and enterprise applications.

Furthermore, there are four (4) main types of data center and these includes;

I. Managed services data centers.

II. Cloud data centers.

III. Colocation data centers.

IV. Enterprise data centers.

9. Which is an example of a function?
(1 Point)
=A1 +A2
=SUM(A1:A3)
=ADD(A1:A3)​

Answers

Answer: i'd make a guess, not answer probably, but A1 +A2?

Explanation: it has plus sign?

Answer: SUM(A1:A3)

Explanation:



1. What is document formatting? Give significance of speller and thesaurus of word processing package.​

Answers

Answer:

hope it is helpful to you

stay safe, happy and healthy

Formatted the text in a document can draw the reader's attention to specific parts of a document and it also emphasize important information. In the word file, a person may have several options for adjusting the text, including font, size, and color.

What is Document formatting?

Document formatting can be referred to as the way in which a document is laid out on the page, it is the way in which it looks and is visually organized and it addresses all the things such as font selection, font size and presentation like bold or italics font, spacing, margins, alignment, columns, indentation, and lists.

Document formatting is the mechanics of how the words appear on the page or the document. A well formatting document is consistent, and it is correct in terms of meeting any stated requirements, and easy to be read by anyone.

Learn more about Document formatting here:

https://brainly.com/question/21934838


#SPJ2

Write an application that prompts a user for two integers and displays every integer between them. Display There are no integers between X and Y if there are no integers between the entered values. Make sure the program works regardless of which entered value is larger.

Answers

Answer:

x = int(input("Enter an integer: "))

y = int(input("Enter another integer: "))

if x > y:

   for number in range(y+1, x):

       print(number, end=" ")

elif y > x:

   for number in range(x+1, y):

       print(number, end=" ")

else:

   print("There are no integers between {} and {}".format(x, y))

Explanation:

*The code is in Python.

Ask the user to enter the two integers, x and y

Since we want our program to run regardless of which entered value is larger, we need to compare the numbers to be able to create the loop that prints the numbers.

Check if x is greater than y. If it is, create a for loop that iterates from y+1 to x-1 and print the numbers

Otherwise, check if y is greater than x. If it is, create a for loop that iterates from x+1 to y-1 and print the numbers

If none of the previous part is executed, print that there are no integers between

Todd Wallace works as the chief knowledge officer for Pennsylvania Lumber Company. He has been given the responsibility to create a product or service that will bring an added value to its customers to increase the company's revenue. Todd determines that the best value he can add is by creating a service that offers free next day shipping on any order over $50. Where in the value chain is Todd adding value?

a. The primary value activity inbound logistics
b. The primary value activity marketing and sales
c. The primary levy outbound logistics

Answers

Answer:

c. The primary levy outbound logistics.

Explanation:

Todd Wallace has identified a marketing strategy and has introduced a levy on outbound logistics for its customers. It has introduced a campaign for its customer free shipping on an order of $50 or above.

TRUE or FALSE: CSS is used to style web pages.

Answers

Answer:

true

Explanation:

HTML is the structure and CSS is the design

Debug the recursive reverseString method, which is intended to return the input String str reversed (i.e. the same characters but in reverse order).
Use the runner class to test this method but do not write your own main method or your code will not be graded correctly.
public class U10_L2_Activity_One
{
public static String reverseString(String str)
{
if (str.length() < 0)
{
return str;
}
s = reverseString(str.substring(2)) + str.substring(0,1);
}
}
Runner's code (don't change):
import java.util.Scanner;
public class runner_U10_L2_Activity_One
{
public static void main(String[] args)
{
System.out.println("Enter string:");
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
System.out.println("Reversed String: " + U10_L2_Activity_One.reverseString(s));
}
}

Answers

Answer:

Explanation:

The following modified code correctly uses recurssion to reverse the string that was passed as a parameter to the reverseString method. A test output using the runner class can be seen in the attached image below.

import java.util.Scanner;

class U10_L2_Activity_One {

   public static String reverseString(String str) {

       if (str.isEmpty()) {

           return str;

       }

       return reverseString(str.substring(1)) + str.charAt(0);

   }

}

class runner_U10_L2_Activity_One

{

   public static void main(String[] args)

   {

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

       Scanner scan = new Scanner(System.in);

       String s = scan.nextLine();

       System.out.println("Reversed String: " + U10_L2_Activity_One.reverseString(s));

   }

}

Write a program that reads in 10 numbers and displays the number of distinct numbers and the distinct numbers in their input order and separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). After the input, the array contains the distinct numbers. Here is a sample run of the program.

Answers

Answer:

Explanation:

The following code is written in Python. It creates a for loop that iterates 10 times, asking the user for a number every time. It then checks if the number is inside the numArray. If it is not, then it adds it to the array, if it is then it skips to the next iteration. Finally, it prints the number of distinct numbers and the list of numbers.

numArray = []

for x in range(10):

   num = input("Enter a number")

   if int(num) not in numArray:

       numArray.append(int(num))

print("Number of Distince: " + str(len(numArray)))

for num in numArray:

   print(str(num), end = " ")

List the invoice number and invoice date for each invoice that was created for James Gonzalez but that does not contain an invoice line for Wild Bird Food (25lb).

Answers

Answer:

Derive FROM invoice_transaction, invoice_details, item_details

and JOIN customer_details  ON (invoice_transaction.CUST_ID = customer_details.CUST_ID  AND customer_details.FIRST_NAME = 'James'   AND customer_details.LAST_NAME  = 'Gonzalez')

Explanation:

The following details will be there in the invoice

item_details rep_details invoice_details customer_details invoice_transaction

 Derive FROM invoice_transaction, invoice_details, item_details

and JOIN customer_details  ON (invoice_transaction.CUST_ID = customer_details.CUST_ID  AND customer_details.FIRST_NAME = 'James'   AND customer_details.LAST_NAME  = 'Gonzalez')

Other Questions
Hey, I need help with biology. Thanks. names for a male puppy ? ? Select the true statement about Triangle ABC. Hey! can someone help me find the value of x please??! Find the area of the sector. Use 3.14 for pl and round youranswer to the nearest tenth if necessary.19 m After having his wish granted, Modas looks forward to Convert the equation into Slope Intercept form (y=mx+b).9y = -3x + 5 What is another name for a republic? What basic view of culture underlies the structural-functional approach? The social conflict approach? This question refers to the basic view of culture underlying these two paradigms. definition of atitude scale Landscape paintings such as this were popular during which dynasty? Ming dynasty Song dynasty Han dynasty Tang dynasty On January 2, 2017, Concrete Master Construction, Inc. issued $500,000, ten-year bonds for $574,540. The bonds pay interest on June 30 and December 31. The face rate is 8% and the market rate is 6%. What is the carrying value of the bonds after the first interest payment is made on June 30, 2017 Match each equation with the correct number of solutions 8 of 8Work out the mean for the data setbelow:2.3, 0.3, 7,6.1, 9.7Give your answer as a decimal. Who is the first ever president? arett Motors is trying to decide whether it should keep its existing car washing machine or purchase a new one that has technological advantages (which translate into cost savings) over the existing machine. Information on each machine follows: Old machine New machine Original cost $9,000 $20,000 Accumulated depreciation 5,000 0 Annual cash operating costs 9,000 4,000 Current salvage value of old machine 2,000 Salvage value in 10 years 500 1,000 Remaining life 10 yrs 10 yrs Refer to Jarett Motors. The $4,000 of annual operating costs that are common to both the old and the new machine are an example of a(n) Select one: a. opportunity cost b. irrelevant cost c. future avoidable cost d. sunk cost What is the name and function of the structure indicated by A? Jessie has three one-gallon containers. The first one has 1/5 of a gallon of juice, the second has 1/5 gallon of juice and the third has 1/5 gallons of juice. How many total gallons of juice does Jesse have? Plz help me if you know the answer plz and thank you :)