Short Java Assignment

#1. I need to write a Java program that calculates the sum of numbers from 1 through 10,000 (including 1 and 10,000) but omitting numbers that are divisible by three and numbers whose hundred digit is 2 or 3 (for example 1200 or 3312).

 

#2. Write a Java program that displays all 4-character strings in lexicographic order (also called dictionary order) on the screen. It must display a string of 4 characters per line. Only the characters a, b, c, d are allowed within character strings, but you can reuse the same character more than once within the same string. Within a single string, the character "b" must always be immediately followed by the character "a". The same string cannot contain both the character "d" and the character "a". Your program should end with the number of character strings displayed on the screen. Your program receives nothing as input. Your program code must not include pre-calculated strings: it must generate them at runtime. Your program should not contain more than 200 short lines of code.

Need a custom answer at your budget?

This assignment has been answered 4 times in private sessions.

© 2024 Codify Tutor. All rights reserved