Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication1;
- import java.util.Scanner;
- import static javafx.scene.input.KeyCode.O;
- /**
- *
- * @author User
- */
- public class JavaApplication1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- Scanner sc1 = new Scanner(System.in);
- double $band= 0;
- double sTRF = 0;
- System.out.println("Enter Contract Number: ");
- int contract = sc.nextInt();
- //Input sa contract
- if(contract>=10000 && contract<=99999){
- //inig true ni musulod sya sa mga code
- //nasa sulod sad ang uban input para inig dili mo true ang statement mo error sya diretso
- System.out.println("Enter First Name: ");
- String fName = sc1.nextLine();
- System.out.println("Enter Last Name: ");
- String lName = sc1.nextLine();
- //input sa name
- System.out.println("Enter Month: ");
- int month = sc.nextInt();
- //input sa month
- String $month = "Unknown";
- if(month>=1 && month<=12){
- //if mo true ang statement diria moproceed sya sa mga designated na mga codes apil na ang mga uban pa inputs
- //Reason ngano gisulod nako kay para inig false ang statement di sya mo proceed sa uban pang inputs nya mo error sya diretso
- switch (month){
- case 1:
- $month = "January";
- break;
- case 2:
- $month = ("February");
- break;
- case 3:
- $month = ("March");
- break;
- case 4:
- $month = ("April");
- break;
- case 5:
- $month = ("May");
- break;
- case 6:
- $month = ("June");
- break;
- case 7:
- $month = ("July");
- break;
- case 8:
- $month = ("August");
- break;
- case 9:
- $month = ("September");
- break;
- case 10:
- $month = ("October");
- break;
- case 11:
- $month = ("November");
- break;
- case 12:
- $month = ("December");
- break;
- default:
- $month = ("Error");
- }
- System.out.println("Enter Day: ");
- int day = sc.nextInt();
- System.out.println("Contract: " + contract);
- System.out.println("First Name: " + fName);
- System.out.println("Last Name: " + lName);
- if (day>=1 && day<=31){
- System.out.println("Enter Year: ");
- int year = sc.nextInt();
- if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12){
- if (day>=1 && day<=31){
- System.out.println($month + " " + day + " " + year);
- }
- else {
- System.out.println("Error");
- }
- }
- else if (month == 4 || month == 6 || month == 9 || month == 11){
- if (day>=1 && day<=30){
- System.out.println($month + " " + day + " " + year);
- }
- else {
- System.out.println("Error");
- }
- }
- else if (month == 2) {
- if (day>=1 && day<=28){
- System.out.println($month + " " + day + " " + year);
- }
- else {
- System.out.println("Error");
- }
- }
- else {
- System.out.println("Error");
- }
- //input sad ning sa ubos
- System.out.println("Enter Number of Guests: ");
- int guest = sc.nextInt();
- System.out.println("Cocktail? (Y or N): ");
- String cL = sc1.nextLine();
- System.out.println("Appetizer? (Y or N): ");
- String aP = sc1.nextLine();
- System.out.println("Dinner? (Y or N): ");
- String dR = sc1.nextLine();
- System.out.println("Band? (Y or N): ");
- String _band = sc1.nextLine();
- //nasulod sya diria kay tungod para mo error inig mali ang day pagkainput
- double bguest = 5*guest;
- System.out.println("Contract: " + contract);
- System.out.println("First Name: " + fName);
- System.out.println("Last Name: " + lName);
- System.out.println("Guests: " + guest);
- if (cL.equalsIgnoreCase("Yes")){
- cL = "Yes";
- }
- else if (cL.equalsIgnoreCase("No")){
- cL = "No";
- }
- else {
- cL = "Yes";
- }
- if (aP.equalsIgnoreCase("Yes")){
- aP = "Yes";}
- else if (aP.equalsIgnoreCase("Yes")){
- aP = "No";
- }
- else{
- aP = "Yes";
- }
- if (dR .equalsIgnoreCase("Yes")){
- dR = "Yes";
- }
- else if (dR .equalsIgnoreCase("No")){
- dR = "No";
- }
- else{
- dR = "Yes";
- }
- if (cL == "Yes" && aP == "No" && dR == "No" ){
- sTRF = + 15;
- }
- else if(cL == "No" && aP == "Yes" && dR == "No" ){
- sTRF = + 12;
- }
- else if(cL == "No" && aP == "No" && dR == "Yes" ){
- sTRF = + 19;
- }
- else if (cL == "Yes" && aP == "Yes" && dR == "No" ){
- sTRF = + 22;
- }
- else if (cL == "Yes" && aP == "No" && dR == "Yes" ){
- sTRF = + 26;
- }
- else if (cL == "No" && aP == "Yes" && dR == "Yes" ){
- sTRF = + 24;
- }
- else if (cL == "Yes" && aP == "Yes" && dR == "Yes" ){
- sTRF = + 36;
- }
- else {
- System.out.println("ERROR!");
- }
- if(_band.equalsIgnoreCase("Yes")){
- $band = + 500;
- }
- double tRF = (bguest * sTRF) + $band;
- System.out.println("Total Fee Revenue: " + tRF);
- }
- else {
- System.out.println("Error!");
- }
- }
- else {
- System.out.println("Error!");
- }
- }
- else {
- System.out.println("ERROR!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement