
Java language pls write a main program of the language class given below and make sure that your output matches with the one given below.
Language.java
public final class Language {
//
// Static Data Fields
//
private static final String defaultAlienSound = "~ ąļīæń ~ "; // Default
//
// Instance Data Fields
//
//
// Constructors
//
public Language() {
}
public Language(String language) {
switch (language.toLowerCase()) {
case "alien" -> this.populateAlienPhrases(); // Supported
case "chinese" -> this.populateChinesePhrases(); // Future implementation
case "french" -> this.populateFrenchPhrases(); // Future implementation
case "spanish" -> this.populateSpanishPhrases(); // Future implementation
case "future" -> this.populateYourLanguagePhrases(); // Future implementation
default -> this.populateEnglishPhrases(); // Supported
}
}
//
// Static Methods
//
//
// Additional Static Methods
//
//
// Instance Methods
//
//
// Language
//
}
Sample run output for language
----------------------------------------------------------------------
---------------------- SF GIANTS THANK YOU --------------------------- ----------------------------------------------------------------------
Language: Alien
~ ąļīæń ~ PST
~ ąļīæń ~
~ ąļīæń ~ ~ ąļīæń ~
~ ąļīæń ~ ~ ąļīæń ~
Sample run output for exception handling
Language: Meow
Language: UNSUPPORTED language. Please enter your language.
Language: English, Chinese, French, Spanish, Alien
Language: Java
Language: UNSUPPORTED language. Please enter your language.
Language: English, Chinese, French, Spanish, Alien
Language: English
Time Zone: Elon Musk
Time Zone: INVALID time zone. Please enter your time zone.
Time Zone: Lunch Time
Time Zone: INVALID time zone. Please enter your time zone.
Time Zone: PST --------------------------------

Step by stepSolved in 4 steps with 2 images

- Java Assignment: Experiment with naming rules in Java Does the language use static or dynamic scoping? Can scopes nest? Are they open or closed? Does the scope of a name encompass the entire block in which it is declared, or only the portion after the declaration? How does one declare mutually recursive types or subroutines? Can subroutines be passed as parameters, returned from functions, or stored in variables? If so, when are referencing environments bound? Justify your answers with suitable code snippet and its output.arrow_forwardQUESTION 5 Competition synchronization constructs in Java are provided by the Object class. True Falsearrow_forward4 Object Oriented Programming Assignment - 11 Write a Java program for the following Class Diagram. Document authors: String date: Date getAuthors: String addAuthoriname):void getDate()date Book -titleString getitiet): String EMail Subject: String -to: Stringl) getSubject) String getToString Instructions: 1. This java program is for an application that stores the author (Writer) data of some books and emails 2. getAuthors() method get the list of authors and store it in a String array. 3. addAuthors() method is used to add an author anytime for book or email. 4. getDate() method get the date of the book or email 5. getTitle() method can be used to get the title of the book 6. getSubject() method is used to get the Subject of the email. 7. getTo() method is used to get the information about the mail to whom it is sent. 8. All get methods need to return the values in the corresponding instance variables. 9. Scanner class can be used to set the data for the variables. The programmer can…arrow_forward
- 1arrow_forwardJAVA Data type Java assignment meaning of operator int float double and string Pick one Java polymorphic arithmetic operator and write Java code statements that demonstrate its function for ints, floats, doubles, and strings. Also, indicate what role the operator is performing in the table below.arrow_forwardQuèstion 24 Methods are used to implement all assignment, relational and arithmetic operators in some programming languages e.g. Ruby and Racket. True Falsearrow_forward
- Design a NFA for the language: L: {an| n is even or divisible by 3} Which of the following methods can be used to simulate the same. i. e-NFA ii. Power Construction Method iii. Both (a) and (b) iv. None of the mentionedarrow_forwardAssignment 16: Iteration Control Structure - Hands on practice Hint: Consider numbers 1 to 10, for each number find the odd multiples. Example, for 1, it should be 1, 3, 5, 7, 9 Objective: Given a real world problem, implement the logic and solve the problem using appropriate constructs (sequen- tial, selection, iteration) using an object oriented program- ming language (Java) for 2, it should be 2, 6, 10, 14, 18 Estimated time: 50 minutes Summary of this assignment: In this assignment, you have learnt the implementation of iteration control structures. Problem Description: Write simple java programs to implement the following prob- lems. 1.Find the sum of first 5 numbers (1 to 5) using for loop End of document statement 2.Find the product of first 5 numbers (1 to 5) using while loop statement 3. Generate the multiplication table of 10 upto multiple value 500 4.Calculate the square of first 5 numbers (1 to 5) using do..while statement 5.Find the odd multiples among the first 10…arrow_forwardC++languagearrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





