Jump to content

Need a little help, with a few different number problems.


JohnBC2012

Recommended Posts

I am learning Pseudocode and flowcharts right now in college, Getting the hang of that. BUT the Java for it, Is still new to me, Home work, Extra credit (option) but would like to do it, isWrite an .htm file containing a JavaScript program for each problem1. Input a number, and output, for that number and the next 9 numbers, the number, double the number and triple the number. Use a loop to increment and output the numbers.2. Input a number between 1 and 99, and output every even number between that number and 1003. Input two numbers, and tell the user if both the first is less then 10 and the second is greater then 20. Output "Yes" or "No"We have done basic Java, "Hello World" tutorial that is from here, but nothing like adding numbers and finding out things, I tried looking for examples, But I get lost verrrrry easy. Any help would be greatly appreciated! BIG TIME, Even tho extra credit, I would like to KNOW how to do these.

Link to comment
Share on other sites

A basic principle is do the required before you do the extra credit. Under the circumstances, you need to post some code that you've made some informed effort.

Edited by niche
Link to comment
Share on other sites

Ok fair enough, Don't mind at all, My problem with number 1 is adding the next 9 numbers. I honestly dont know how to do that. Ok giving this a try lol <script language="javascript"><!-- function is_int(value){ if((parseFloat(value) == parseInt(value)) && !isNaN(value)){ return true; } else { return false; }} function answerOne(id) str += "\n<br />Double: " + parseInt(num)*2 + "\n<br />Triple: " + parseInt(num)*3;div.innerHTML = str;} else {div.innerHTML = "<span style=\"color:blue; font-weight:bold\">What is your number</span>"; } } } --></script>

Edited by JohnBC2012
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...