This file contains hidden or 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 intro; | |
import userlib.TextIO; | |
public class intro { | |
public static void main(String[] args){ | |
int x,y; | |
System.out.println("Enter a number to convert: "); | |
x = TextIO.getInt(); | |
while(x<0||x>=16){ | |
TextIO.putln("Wrong input, it must be lower than 15 and greater than 0"); |
This file contains hidden or 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 intro; | |
import userlib.TextIO; | |
import java.util.*; | |
import java.lang.String; | |
import java.lang.Character; | |
public class CheckPassWord { | |
public static void main(String[] args){ | |
String pwd; | |
TextIO.putln("Enter your password: "); |
This file contains hidden or 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
import java.util.Scanner; | |
import java.util.Random; | |
/** | |
*Candygame | |
* | |
*/ | |
public class CandyGame { | |
public static void main(String[] args) { | |
System.out.println("Welcome to Candy Game"); |
This file contains hidden or 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
/** | |
* (Find the number of years) Write a program that prompts the user to enter the | |
* minutes (e.g., 1 billion), and displays the number of years and days for the minutes. | |
* For simplicity, assume a year has 365 days. | |
* | |
* @author Tom | |
* @version (a version number or a date) | |
*/ | |
import java.util.Scanner; |
This file contains hidden or 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 output is the monthly payment and total payment, | |
* which can be obtained using the following formulas: | |
* monthlyPayment = loanAmount * monthlyInterestRate /(1 - 1 / Math.pow(1 + monthlyInterestRate, numberOfYears * 12)); | |
* totalPayment = monthlyPayment * numberOfYears * 12 | |
* So, the input needed for the program is the monthly interest rate, the length of the loan in years, and the loan amount. | |
* | |
* @author Tom | |
* @version (a version number or a date) |
This file contains hidden or 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
/** | |
* Write a description of class CalArea here. | |
* | |
* @author (Tom) | |
* @version (a version number or a date) | |
*/ | |
import java.util.Scanner; | |
public class CalArea{ | |
// instance variables - replace the example below with your own |
NewerOlder