Question

Write a program that declares variables named init1, init2, and init3, to hold your three initials....

Write a program that declares variables named init1, init2, and init3, to hold your three initials. Display the three initials with a period following each one, as in J.M.F. When submitting the program for testing/grading, assign the values J, M, and F to init1, init2, init3, respectively.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

public class Initials { //begin class
public static void main(String[] args){
/*There are multiple ways to approach this assignment.
* I've decided to declare three character fields and print them.
*/

char init1 = 'J';
char init2 = 'M';
char init3 = 'F';
System.out.println(init1+"."+init2+"."+init3+".");
}//end main

}//end class

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Write a program that declares variables named init1, init2, and init3, to hold your three initials....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C# program named Miles-ToEest that declares a named constant that holds the number of...

    Write a C# program named Miles-ToEest that declares a named constant that holds the number of feet in a mile: 5280. Also declare a variable to represent the distance in miles between your house and your uncle's house. Assign an appropriate value to the variable-for example, 8.5. Compute and display the distance to your uncle's house in both miles and feet. Display explanatory text with the values-for example, The distance to my uncle's house is 8.5 miles or 44880 feet....

  • Write a program that declares an initializes two variables a & b with the values your...

    Write a program that declares an initializes two variables a & b with the values your choice, use pointer to those variables and perform, addition, subtraction and multiplication: Print the results.

  • Question 16 (4 points) Write a complete C program that declares four variables of type integer...

    Question 16 (4 points) Write a complete C program that declares four variables of type integer (i.e integer variables) and four variables of type pointer to integer (i.e. integer pointers). Assign the addresses into the pointers. Using the indirection operator with a pointer, assign the values 1, 2, 3, and 4 into the four integers. (Use the indirection operator with the pointers to write the integer values.) Your program should write the addresses and values of all eight variables to...

  • Need this program in C#. Thank you 3/19 Lab11 PartC Dur Scenario/Summary Write a windows console...

    Need this program in C#. Thank you 3/19 Lab11 PartC Dur Scenario/Summary Write a windows console application that holds data about an item in a retail store. Your class should be named Retailltem and should hold data about an item in a retail store. The class will have the following member variables. Description- string holding the description of the item, unitsOnHand - int that holds the number of units in inventory Price - double that holds the price of the...

  • Create the pseudo-code/flowchart for an application class named Monogram. Its main() method inputs three variables that...

    Create the pseudo-code/flowchart for an application class named Monogram. Its main() method inputs three variables that hold your first, middle, and last initials, respectively. Create a method(called Monogram()) to which you pass the three initials and that displays the initials twice—once in the order of first, middle, and last, and a second time in traditional monogram style (first, last, middle). Main inputs the data, you pass it to the Monogram Function, which will output the data

  • Write a JAVA program that declares a class Pet  With three variables Name, Age, weight .The class...

    Write a JAVA program that declares a class Pet  With three variables Name, Age, weight .The class has  different constructors the first without parameters ,the  second with three parameters and the third with two parameters. In the main method  create three objects using thee different constructors to initialize the Variables.  then print out all the information a bout all objects .

  • Write, compile, and test a class that displays your first name on the screen. Save the...

    Write, compile, and test a class that displays your first name on the screen. Save the class as Name. Write, compile, and test a class that displays your full name, street address and city, on three separate lines on the screen. Save the class as Address. Write a java program which add two numbers and print the result on screen. Save the class as Add2. Write a java program which accepts two numbers from user multiply them and print the...

  • Please help in C# CHECKS: Function Reverse reverses the position of three integers Values printed in...

    Please help in C# CHECKS: Function Reverse reverses the position of three integers Values printed in order and in reverse order --------------------------------------------------------------------------- Create a program named Reverse3 whose Main() method declares three integers named firstInt, middleInt, and lastInt. Assign the following values to the integers: 23 to firstInt 45 to middleInt 67 to lastInt Then display the values and pass them to a method named Reverse that accepts them as reference variables, places the first value in the lastInt variable,...

  • Create a program using Visual Studio 2017 called dataExercise.c that declares the following variables and displays...

    Create a program using Visual Studio 2017 called dataExercise.c that declares the following variables and displays their values: 1. Declare a character variable with value 'a', and display the character using printf with a %c format. Then add a second printf that displays the character with a %d format. 2. Declare a short int variable with a value set to the maximum value of a short int (the maximum value for whatever machine I happen to use to grade your...

  • Test Scores and Grade Write a program that has variables to hold three test scores. The...

    Test Scores and Grade Write a program that has variables to hold three test scores. The program should ask the user to enter three test scores and then assign the values entered to the variables. The program should display the average of the test scores and the letter grade that is assigned for the test score average. Use the grading scheme in the following table: Test Score Average Letter Grade 90–100 A 80–89 B 70–79 C 60–69 D Below 60...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT