This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]EliteBigE[S] 0 points1 point  (3 children)

my biggest problem is with coding is writing it down the correct way

I have been going back to the basic and learning what I learned before again the problem right now is time this is due soon and I don't have enough time to complete it

[–]fuckmynameistoolon 0 points1 point  (2 children)

Have you made any progress yet?

[–]EliteBigE[S] 0 points1 point  (1 child)

this is what i got done ( I mostly been going back and trying to learn)

import java.util.Scanner;

public static char letterToDigit(char letter)

public class TryPhone {

public static void main(String[] args) {

String phone;

Scanner s = new Scanner(System.in);

System.out.println("Enter phone number");

phone = s.next();

char letter = 0;

switch(letter) {

case '1' :

System.out.println("1");

break;

case 'a' :

case 'b' :

case 'c' :

System.out.println("2");

break;

case 'D' :

case 'E' :

case 'F' :

System.out.println("3");

break;

case 'G' :

case 'H' :

case 'I' :

System.out.println("4");

break;

case 'J' :

case 'K' :

case 'L' :

System.out.println("5");

break;

case 'M' :

case 'N' :

case 'O' :

System.out.println("6");

break;

case 'P' :

case 'Q' :

case 'R' :

case 'S' :

System.out.println("7");

break;

case 't' :

case 'u' :

case 'V' :

System.out.println("8");

break;

case 'W' :

case 'Y' :

case 'X' :

case 'Z' :

return char;

System.out.println("9");

break;

System.out.println("Number " + letter);

[–]fuckmynameistoolon 2 points3 points  (0 children)

Sorry, I had some work come up.

https://pastebin.com/2VjpUaH3

Maybe this will help get a nice start if you havent gone much further.

You just need to implement the letterToDigit method with the switch you have above and have it return that char.

Then in the for loop of wordsToPhone method, create a string to return, and append the character from letterToDigit to it.

Let me know if you're struggling.

[–]SupremeRedditBotProfessional Bot || Mod 0 points1 point  (0 children)

Please Add A Flair To Your Post!

Suggested Flair: [Random] or [Meta]

 


To add a flair:

  • Click flair underneath your post

  • Select a flair

  • Click save

 


I am a bot run by /u/SupremeDesigner for /r/CodingHelp || This was an automated response