We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,470 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Please can anyone help solve this ?

Application coding
Project Name: PhoneProblem

Write a program which allows the user to input information to solve the following problem:

“Sometimes it’s difficult to decide which phone to use – my mobile phone or my home phone. If I’ve got free minutes left on my mobile phone, then I use them – but only if I’m calling a land line or the person I want to call uses the same network provider that I have. If I don’t have free minutes left, then I use the home phone (as long as I’m at home) – unless it’s on the same network, in which case it’s still cheaper to use the mobile. Having said that, sometimes my flatmate is on the home phone, and so if it’s urgent I have to use my mobile anyway. If it is not urgent then I will wait until my flatmate has finished then use the home phone”.

Anyone who can make this work , I am truly grateful, Ive spent hours making flow diagrams and doing psuedo code and to no avail. Many thanks, Jenny

7
Contributors
10
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
11
Views
Question
Answered
jennyb
Newbie Poster
3 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Where are you stuck? Do you have any specific questions about the program?

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

Where are you stuck? Do you have any specific questions about the program?

Thanks so much for coming back to me, Specific no, all of it yes. I have not choice but to do the code, but I cant break down the pseudo code into an actual Java application.

Im not a techy, nor do I pretend to be, I really need a kind person who will put the problem into a java application. )

Im a girl in desperation !

jennyb
Newbie Poster
3 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Sounds like you need to hire a programmer if you're not interested in learning how to program.

NormR1
Posting Sage
Team Colleague
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16

show us some of your pseudocode so we can see if theres something wrong with that first

Philippe.Lahaie
Posting Whiz
360 posts since Oct 2007
Reputation Points: 103
Solved Threads: 54
Skill Endorsements: 4

Im not a techy, nor do I pretend to be, I really need a kind person who will put the problem into a java application. )

Im a girl in desperation !

You're also a girl violating the forum rule about showing effort if you expect help with homework assigments.

If you can't show that you have made the slightest effort yourself, this thread will be closed. Post code, psuedocode, or at least specific questions that might indicate you are anything other than another lazy student wanting others to do their assignment for them.

Ball is in your court.

Ezzaral
null
Moderator
16,126 posts since May 2007
Reputation Points: 3,294
Solved Threads: 875
Skill Endorsements: 28

The simplest way is...
At the beginning of your program, set a variable.
Using a bunch of "if"s to test all of your conditions, reset the variable.
Your answer will be the value of the variable at the end of all of your "if"s.

hfx642
Posting Pro
515 posts since Nov 2009
Reputation Points: 248
Solved Threads: 105
Skill Endorsements: 1
if (question posted == assignment)
{
    if( effort == 0 ) 
       {
          S.O.P("U r not in the rite place");
       }
    else
       {
          S.o.p("Explain your effort and which part in your code your are struggling with ");
       }

}

else
 {
S.o.p("Explain your effort and which part in your code your are struggling with ");
}
scrappy57
Newbie Poster
12 posts since Mar 2010
Reputation Points: 9
Solved Threads: 1
Skill Endorsements: 0

if (question posted == assignment)
{
if( effort == 0 )
{
S.O.P("U r not in the rite place");
}
else
{
S.o.p("Explain your effort and which part in your code your are struggling with ");
}

}

else
{
S.o.p("Explain your effort and which part in your code your are struggling with ");
}

I doubt that you'll need that nested if there.
it's like testing:

boolean a = getBoolValue();
// a = random true or false
if ( a ){
if ( a ){
// print A
}
else{
// print B
}
}
else{
// print C
}

can you come up with one scenario where B will ever be printed? :)

stultuske
Industrious Poster
4,490 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 630
Skill Endorsements: 25

Hi all

Please ignore this question and thread as I have managed to resolve it myself.

Many thanks

jennyb
Newbie Poster
3 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

well, you can mark this thread as solved, to show that to the other posters.
you could also, if you want to :)
post your solution to the problem you had, so that those who look for it in the future might find it helpfull

stultuske
Industrious Poster
4,490 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 630
Skill Endorsements: 25
Question Answered as of 1 Year Ago by NormR1, stultuske, Ezzaral and 3 others

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0970 seconds using 2.82MB