Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA please Add Number Series Programming challenge description: Write a program that, given an integer, sums all the numbers from 1 through that integer

image text in transcribedIN JAVA please

Add Number Series Programming challenge description: Write a program that, given an integer, sums all the numbers from 1 through that integer (both inclusive). Do not include in your sum any of the intermediate numbers (1 and n inclusive) that are divisible by 5 or 7. Input: Your program should read lines from standard input. Each Line contains a positive integer. Output: For each line of input, print to standard output the sum of the numbers from 1 through n, disregarding those divisible by 5 and 7. Print out each result on a new line. Test 1 Test Input 10 Expected Output 33 impo r t import Import import The and public 10. BufferedReader Java. io. IOException; java. 10. InputStreamReader ; java. nio. charset. StandardCharsets ; Main class implements an application that reads lines from the prints them to the standard output. class Main { 10 11 12 13 15 16 17 18 19 20 22 23 * Iterate through each line Of input . public static void main ( String [ args) throws IOException { InputStreamReader reader new InputStreamReader( System. in, BufferedReader in = new BufferedReader(reader) ; String line; while ( (line in. readLine()) null) { System.out. ( line) ; Stand Test Case Output No results to display. code . Click 'Run Test Cases' Run Test Cases above to test your

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions