In Java
Write methods to perform conversion routines.
If user selects 4----methods intro( ) , para 2 ( ) , and para 3 ( ) will be called in order (with a blank line between paragraphs).
Four score and seven years ago our fathers brought forth on this continent a new nation,
conceived in liberty and dedicated to the proposition that all men are created equal.
Now we are engaged in a great civil war, testing whether that nation or any nation
so conceived and so dedicated can long endure. We are met on a great battlefield of
that war. We have come to dedicate a portion of that field as a final resting-place
for those who here gave their lives that that nation might live. It is altogether
fitting and proper that we should do this.
But in a larger sense, we cannot dedicate, we cannot consecrate, we cannot hallow
this ground. The brave men, living and dead who struggled here have consecrated it
far above our poor power to add or detract. The world will little note nor long
remember what we say here, but it can never forget what they did here. It is for us
the living rather to be dedicated here to the unfinished work which they who fought
here have thus far so nobly advanced. It is rather for us to be here dedicated to
the great task remaining before us -- that from these honored dead we take increased
devotion to that cause for which they gave the last full measure of devotion -- that
we here highly resolve that these dead shall not have died in vain, that this nation
under God shall have a new birth of freedom, and that government of the people, by
the people, for the people shall not perish from the earth.
Four score and seven years ago our fathers brought forth on this continent a new nation,
conceived in liberty and dedicated to the proposition that all men are created equal.
Now we are engaged in a great civil war, testing whether that nation or any nation
so conceived and so dedicated can long endure. We are met on a great battlefield of
that war. We have come to dedicate a portion of that field as a final resting-place
for those who here gave their lives that that nation might live. It is altogether
fitting and proper that we should do this.
But in a larger sense, we cannot dedicate, we cannot consecrate, we cannot hallow
this ground. The brave men, living and dead who struggled here have consecrated it
far above our poor power to add or detract. The world will little note nor long
remember what we say here, but it can never forget what they did here. It is for us
the living rather to be dedicated here to the unfinished work which they who fought
here have thus far so nobly advanced. It is rather for us to be here dedicated to
the great task remaining before us -- that from these honored dead we take increased
devotion to that cause for which they gave the last full measure of devotion -- that
we here highly resolve that these dead shall not have died in vain, that this nation
under God shall have a new birth of freedom, and that government of the people, by
the people, for the people shall not perish from the earth.
NOV-16 Task Write a Java program that prompts the user to select an integer value between 1 and 4 that corresponds to a section of President Abraham Lincoin\'s Gettysburg Address. The program will have three methods in addition to main(): intro()para2(), and para3().The main) method outputs the prompt, reads in the selections and then calls the appropriate method to output the part(s) of the speech selected None o these methods returns a value, therefore the call to the method wil be a statement rather than an ase is a statement that will call the intro() method. The intro()method outputs ment statement a intro, Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. The para2() method outputs the phrase Now we are engaged in a great civil var, testing whether that nation or any nation so conceived and so dedicated can long endure. We are net on a great battlefield of that var. We have come to dedicate a portion of that field as a final resting-place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. The para3() method outputs the phrase But in a larger sense, ve cannot dedicate, ve cannot consecrate, we cannot hallow this ground. The brave men, living and dead who struggled here have consecrated it far above our poor power to add or detract. The world wil1 little note nor long renenber what we say here, but it can never forget what they did here. It is for us the living rather to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task renaining before us that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion that ve here highly reaolve that these dead shall not have died in vain, that this nation under God shall have a new birth of freedom, and that governnent of the people, by the people, for the people shal1 not perish from the earth the user solocts 4, methods intro() , para2( )·and para 3 ( ) wl be called in order (with a blank line betwoon paragraphs).
Hi, Please find my imlementation.
Please let me know in case of any issue.
import java.util.Scanner;
public class Lab6c {
public static void main (String[] args) {
Scanner scnr = new Scanner(System.in);
System.out.print(\"Enter a number in range (1-4) ? \" );
int num = scnr.nextInt();
blank();
if(num == 1){
intro();
}else if(num == 2){
para2();
}else if(num == 3){
para3();
}else if(num == 4){
intro();
para2();
para3();
}
/* If input is
* 1 -> print paragraph 1 by calling intro()
* 2 -> print paragraph 2 by calling para2()
* 3 -> print paragraph 3 by calling para3()
* 4 -> print all paragrahs in order 1, 2, 3
*/
}
public static void intro() {
System.out.println(\"Four score and seven years ago our fathers brought forth on this continent a new nation,\"+
\"conceived in liberty and dedicated to the proposition that all men are created equal.\");
}
public static void para2() {
System.out.println(\"Now we are engaged in a great civil war, testing whether that nation or any nation\"+
\"so conceived and so dedicated can long endure. We are met on a great battlefield of\"+
\"that war. We have come to dedicate a portion of that field as a final resting-place\"+
\"for those who here gave their lives that that nation might live. It is altogether\"+
\"fitting and proper that we should do this.\");
}
public static void para3() {
System.out.println(\"But in a larger sense, we cannot dedicate, we cannot consecrate, we cannot hallow\"+
\"this ground. The brave men, living and dead who struggled here have consecrated it\"+
\"far above our poor power to add or detract. The world will little note nor long\"+
\"remember what we say here, but it can never forget what they did here. It is for us\"+
\"the living rather to be dedicated here to the unfinished work which they who fought\"+
\"here have thus far so nobly advanced. It is rather for us to be here dedicated to\"+
\"the great task remaining before us — that from these honored dead we take increased\"+
\"devotion to that cause for which they gave the last full measure of devotion — that\"+
\"we here highly resolve that these dead shall not have died in vain, that this nation\"+
\"under God shall have a new birth of freedom, and that government of the people, by\"+
\"the people, for the people shall not perish from the earth.\");
}
public static void blank() {
System.out.println(); // blank line
}
}
/*
Sample output:
Enter a number in range (1-4) ? 3
But in a larger sense, we cannot dedicate, we cannot consecrate, we cannot hallowthis ground. The brave men, living and dead who struggled here have consecrated itfar above our poor power to add or detract. The world will little note nor longremember what we say here, but it can never forget what they did here. It is for usthe living rather to be dedicated here to the unfinished work which they who foughthere have thus far so nobly advanced. It is rather for us to be here dedicated tothe great task remaining before us — that from these honored dead we take increaseddevotion to that cause for which they gave the last full measure of devotion — thatwe here highly resolve that these dead shall not have died in vain, that this nationunder God shall have a new birth of freedom, and that government of the people, bythe people, for the people shall not perish from the earth.
*/