This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.codegym.task.task01.task0132; | |
/* | |
Sum of the digits of a three-digit number | |
*/ | |
public class Solution { | |
public static void main(String[] args) { | |
System.out.println(sumDigitsInNumber(546)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
• The program should display text on the screen. | |
• The Apple class's addPrice method should not display text on the screen. | |
• The Apple class's applePrice variable must be a static int initialized to zero. | |
• The main method should call the addPrice method only twice. | |
• The Apple class's addPrice method should increase the cost of apples by the passed-in value. | |
*/ | |
public class Solution { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Use the keyboard to enter a year, and then determine the number of days in the year. Display the result as follows: | |
Number of days in the year: x | |
, where | |
x is 366 for a leap year, and | |
x is 365 for an ordinary year. | |
*/ | |
import java.io.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The pedestrian traffic light is programmed as follows: | |
at the beginning of each hour, the green signal is on for three minutes, | |
then the signal is yellow for one minute, | |
and then it is red for one minute. | |
Then the light is green again for three minutes, etc. | |
Use the keyboard to enter a real number t that represents the number of minutes that have elapsed since the beginning of the hour. | |
Determine what color the traffic light is at the specified time. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Describing numbers | |
Enter an integer from the keyboard in the range 1 - 999. | |
*/ | |
import java.io.*; | |
public class Solution { | |
public static void main(String[] args) throws Exception { | |
InputStreamReader sreader = new InputStreamReader (System.in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Positive number | |
Use the keyboard to enter three integers. Display the number of positive numbers in the original set. | |
*/ | |
import java.io.*; | |
import java.util.Scanner; | |
public class Solution { | |
public static void main(String[] args) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Multiplication table | |
Use a while loop to display a 10x10 multiplication table. | |
Separate the numbers using a space | |
*/ | |
import java.io.*; | |
public class Solution { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Even numbers | |
Use a for loop to display even numbers from 1 to 100 inclusive. | |
Display each value on a new line | |
*/ | |
public class Solution { | |
public static void main(String[] args) throws Exception { | |
for (int i =2; i<=100;i=i+2){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html><head> | |
<meta charset="utf-8"> | |
<title> Ndatta's Organic Smoothie </title> | |
</head> | |
<body> | |
<img src="http://static-41.sinclairstoryline.com/resources/media/b01a8518-a9f7-473c-9532-79b060d80678-large16x9_antiagingsmoothies.jpg?1535730870538" width="800" height="500"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head> | |
<meta charset="utf-8"> | |
<title>Asana</title> | |
</head> | |
<body> | |
<p> Asana </p> | |
<table border="2"> | |
<tbody><tr> |
OlderNewer