Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
import static java.lang.System.out;
public class QuarterlySalesSatistics2
{
public static void enterSalesFigures(double [][] companyInfo)
{
Scanner keyboard = new Scanner(System.in);
for(int divisionIndex = 0; divisionIndex < companyInfo.length; divisionIndex++)
{
//first way
//decimal to binary
String binaryString = Integer.toBinaryString(number);
System.out.println("decimal to binary: " + binaryString);
//decimal to octal
String octalString = Integer.toOctalString(number);
System.out.println("decimal to octal: " + octalString);
//decimal to hexadecimal
@ellenia
ellenia / gist:8e9a15adf505d55d6951c6835b96faff
Created October 2, 2017 03:07
Convert Hexadecimal number to Binary, Decimal and Octal in Java
/**
*
* Java program to convert Hexadecimal to binary, decimal and Octal in Java.
* Hexadecimal is base 16, Decimal number is base 10, Octal is base 8
* and Binary is base 2 number which has just two numbers 0 and 1.
* @author
*/
public class ConvertHexaToDecimal {
//Write a program that reads three whole numbers and displays the average of the three numbers.
import java.util.Scanner;
public class ProjectOne {
public static void main(String[] args){
Scanner keyScan = new Scanner(System.in);
System.out.println("This program will take three whole numbers, "
@ellenia
ellenia / SWSales1
Last active September 19, 2017 14:30
/* A software company sells a package that retails for $99. Quantity discounts are given according to the
* the following table:
* Quantity Discount
* 10-19 20%
* 20-49 30%
* 50-99 40%
* 100 or more 50%
* Write a program that asks the user to enter the number of packages purchased. The
* program should then display the amount of the discount (if any) and the total amount of the
* purchase after the discount.
@ellenia
ellenia / SWSales
Last active September 19, 2017 02:21
/* A software company sells a package that retails for $99. Quantity discounts are given according to the
* the following table:
*
* Quantity Discount
* 10-19 20%
* 20-49 30%
* 50-99 40%
* 100 or more 50%
*
* Write a program that asks the user to enter the number of packages purchased. The
/* Write a program that computes the tax ad tip on a restaurant bill
* The program should ask the user to enter the charge for the meal.
* The tax should be 6.75 percent of the meal charge. The tip
* should be 15 percent of the total after adding the tax. Display
* the meal charge, tax amount, and the total bill on the screen.
*/
import java.util.Scanner;
MSOpenTech/redis
https://github.com/MSOpenTech/redis/releases/tag/win-3.0.504
class Program
{
static void Main(String[] args)
{
string fileName =
System.Environment.GetEnvironmentVariable("OUTPUT_PATH");
TextWriter tw = new StreamWriter(@fileName, true);
string res;
int _arr_size = 0;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
int n = Convert.ToInt32(Console.ReadLine());
string[] height_temp = Console.ReadLine().Split(' ');
int[] height = Array.ConvertAll(height_temp,Int32.Parse);