Skip to content

Instantly share code, notes, and snippets.

View mamiwinsfall93's full-sized avatar

Ndatta Fall mamiwinsfall93

  • Bowie, Maryland
View GitHub Profile
@mamiwinsfall93
mamiwinsfall93 / gist:f5b6dc2f670cb153a743c4b1a6240f11
Created January 17, 2020 13:13
Sum of the digits of a three-digit number
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));
@mamiwinsfall93
mamiwinsfall93 / Priceofapples
Created January 17, 2020 14:08
Price of apples
/*
• 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) {
@mamiwinsfall93
mamiwinsfall93 / Number of days in the year
Created January 17, 2020 14:10
Number of days in the year
/*
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.*;
@mamiwinsfall93
mamiwinsfall93 / Crossing the road blindly
Created January 17, 2020 14:11
Crossing the road blindly
/*
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.
*/
@mamiwinsfall93
mamiwinsfall93 / Describing numbers
Created January 17, 2020 14:13
Describing numbers
/*
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);
/*
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 {
@mamiwinsfall93
mamiwinsfall93 / Multiplication table
Created January 17, 2020 14:15
Multiplication table
/*
Multiplication table
Use a while loop to display a 10x10 multiplication table.
Separate the numbers using a space
*/
import java.io.*;
public class Solution {
@mamiwinsfall93
mamiwinsfall93 / Even numbers
Created January 17, 2020 14:16
Even numbers
/*
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){
@mamiwinsfall93
mamiwinsfall93 / ndatta's organic store
Created January 18, 2020 01:42
ndatta's organic store
<!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">
@mamiwinsfall93
mamiwinsfall93 / desc
Created January 18, 2020 01:43
smoothie description
<html><head>
<meta charset="utf-8">
<title>Asana</title>
</head>
<body>
<p> Asana </p>
<table border="2">
<tbody><tr>