/    Sign up×
Community /Pin to ProfileBookmark

Hi, i am HILARIOUSLY and embarrassingly new to Java, i don’t even know the difference between JAVA and JavaScript (i plan to learn it tho.)

So my main reason for coming here is this..

I am VERY new to Java, as i said earlier in fact the only thing i’m solid at is If statements and variables; and i also love the T.V. show Shark Tank…so i decided to create a Javascript dialogue box code (if you would call it that) to calculate the company’s presumed worth from what their equity is and how much they are asking for that equity. The code works fine, and i am a little proud of it although its REALLY noobish and is probably a disgrace to the high level stuff done on here.

The problem is with the feedback part. here’s what i wanted to do
out of 10 if they rate me above or equal to 7 :> confirm(“Thank you for the feedback”)
if they rate me below 6 :> confirm(“good to know, I will continue to improve my skills”)
and if they rate me above 10 :> confirm(“WELL, thank you, i will still continue to improve my skills”)

Here is the code:

[CODE]
var equity=prompt(“How much equity (%) are they offering”)
var price=prompt(“How much money ($) are they asking for that equity”)
var cal1=100/equity
var cal2=cal1*price
confirm(“the entrepreneur is valuing their company at $”+ cal2)

var feedback=prompt(“rate our Shark Tank equity/Company value calculator out of 10”)

if (feedback>=7)
{
confirm(“Thank you for the feedback”)
}
// feedback
if (feedback<6)
{ confirm(“good to know, I will continue to improve my skills”)
}

if (feedback>10)
{
confirm(“WELL, thank you, i will still continue to improve my skills”)
}
[/CODE]

how do i make the above10 rating confirm(“WELL, thank you, i will still continue to improve my skills”) show up without affecting the first confirm(“Thank you for the feedback”).

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@rootMay 23.2016 — JavaScript IS NOT Java

Now if it is Java you want, thats a different language and a different forum.
Copy linkTweet thisAlerts:
@Utter_MayhemauthorMay 23.2016 — so what i posted what is it?, all i know is it has a J two As and a V...
Copy linkTweet thisAlerts:
@rootMay 23.2016 — Are you looking for Java or JavaScript?

They are not the same language, JavaScript has nothing to do whatsoever with Java.

Java is a compiled language meaning that you write your program, you then compile it in to its own EXE file or an applet for web use.

JavaScript os an interpreted language that runs only in web browsers

Its best to know the difference.
Copy linkTweet thisAlerts:
@rootMay 23.2016 — The logic is flawed, you are testing for >7 and also >10 so you will need to order your logic a bit more ... logically

It would also improve your code by decluttering elements that are repeating and use a variable to store the output string
if( feedback &lt; 6){
str = "good to know, I will continue to improve my skills";
}else if (feedback&gt;=7 &amp;&amp; feedback&lt;=10){
str = "Thank you for the feedback";
}else{ // same as &gt;10 because other conditions have been exhauseted, this is the only logicall output
str = "WELL, thank you, i will still continue to improve my skills";
}
// then output the result of your conditional
alert( str );
×

Success!

Help @Utter_Mayhem spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...