0

Can someone help me writing this code in java language please

Write a java program that read your first name and the first name of your friends then the program should compute and prints the percentage of your friends whose first names start with the same letter as your first name The program reads your friends name till the word stop is entered

5th Dec 2019, 3:04 PM
Mark G. Ghrayeb
Mark G. Ghrayeb - avatar
6 odpowiedzi
+ 1
Mark G. Ghrayeb I just did what came to my mind. May be someone else will help you achieve it using what you want. Anyways you're welcome.
5th Dec 2019, 4:26 PM
Avinesh
Avinesh - avatar
+ 1
Public class Markjava { Import java.util.Scanner; Public static void main (String [ ] args) { Scanner input = new Scanner (System.in); String firstname = " " ; String friendsname = " " ; System.out.println("please enter your first name :") ; Firstname = input.next(); do { System.out.println("enter your friends name : ") ; Friendsname = input.next(); Substring(0) Friendsname=firstname } while (!Friendsname.equals(STOP)) }} Thats what i just did Please note guys im just a beginner learner dont judge me, all the respect for you
5th Dec 2019, 3:36 PM
Mark G. Ghrayeb
Mark G. Ghrayeb - avatar
0
Please, show us your efforts (share it in section "codes { }"
5th Dec 2019, 3:10 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Since you said java, it is pretty simple to be honest. Just give it an attempt and try to find some logic. Let us see where you go wrong.
5th Dec 2019, 3:12 PM
Avinesh
Avinesh - avatar
0
Mark G. Ghrayeb Kindly note the format of the input, give every input on a new line. Your name 1st friend 2nd friend 3rd friend : : Enter "stop" to terminate https://code.sololearn.com/cjO4PKUgmTNf/?ref=app
5th Dec 2019, 4:10 PM
Avinesh
Avinesh - avatar
0
Thank you very much i appreciate that, can you do this question by using while and do because im still in this course i didnt get everything yet but if you cant no problem i still appreciate your help thank you a lot much respect
5th Dec 2019, 4:21 PM
Mark G. Ghrayeb
Mark G. Ghrayeb - avatar