posted 1 year ago

Im in my last class to complete my associates degree in Cyber Security. Im currently taking ITP 120 (Java Programming) and I am absolutely and completely lost.

My class consists of a 3 1/2 lecture and then told at the end of class to wait for the next HW assignment in an email.

My background. I quit my law enforcement job over 1 1/2 years ago to go back to school full-time and fast forward to today and Im in my last class for my degree.

I dont know any programming and I am honestly and sincerely paying attention in class. Im 30yrs old so I know how important programming really is and I actually want to learn. Ive been looking at youtube videos, articles, trial and error, etc. and I still dont have a clear direction of what the hell Im supposed to do.... with anything JAVA.....

Its so discouraging to say but Im going to complete my associates degree in cyber security and the most I learned from the degree/college is that If you memorize the quiz questions you will ultimately pass the class. Which leads me to here.

These are our instructions:

Design a Java program that calculates and then outputs the sum of all odd and then all even numbers between 0 and 100 separately. The program finally prints which of these summations is higher and also prints the difference between these two summations.

Tips : ( For Odd numbers generate and add : 1 + 3 + 5 + 7 + ... + 97 + 99 and for Even numbers generate and add 2 + 4+ 6 + 8 + ... 98 + 100 ).You may use the repetition method of your choice (for-loop, while, or do-while) to design your flowchart.

My class consists of a 3 1/2 lecture and then told at the end of class to wait for the next HW assignment in an email.

My background. I quit my law enforcement job over 1 1/2 years ago to go back to school full-time and fast forward to today and Im in my last class for my degree.

I dont know any programming and I am honestly and sincerely paying attention in class. Im 30yrs old so I know how important programming really is and I actually want to learn. Ive been looking at youtube videos, articles, trial and error, etc. and I still dont have a clear direction of what the hell Im supposed to do.... with anything JAVA.....

Its so discouraging to say but Im going to complete my associates degree in cyber security and the most I learned from the degree/college is that If you memorize the quiz questions you will ultimately pass the class. Which leads me to here.

These are our instructions:

Design a Java program that calculates and then outputs the sum of all odd and then all even numbers between 0 and 100 separately. The program finally prints which of these summations is higher and also prints the difference between these two summations.

Tips : ( For Odd numbers generate and add : 1 + 3 + 5 + 7 + ... + 97 + 99 and for Even numbers generate and add 2 + 4+ 6 + 8 + ... 98 + 100 ).You may use the repetition method of your choice (for-loop, while, or do-while) to design your flowchart.

posted 1 year ago

Welcome to the Ranch, Esteban. You

To start, please post whatever code you can manage to cobble together as a starting point (please UseCodeTags) and you can get help from there.

*have*come to the right place.To start, please post whatever code you can manage to cobble together as a starting point (please UseCodeTags) and you can get help from there.

posted 1 year ago

Also, something everyone needs to learn is that coding is 90% thinking, and 10% typing.

think about what you need to to. What are all the little pieces or steps? So for starters, your assignment says to do two things separately.

So the first think I would do is pick ONE to start with, and completely ignore the other. Let assume you want to do the odds first.

Now the problem is easier. So think about that. How would you add up all the odd numbers from 0 to 100? Pretend you are talking to a 10yr old child, giving them directions on how to do it. What would you tell them?

That's how you approach programming problems. You break a large problem down into smaller problems, then you break those down, again, and again, and again...Once you have the smallest steps, you start writing it in code, testing and validating it after adding each new piece.

As Bear says, post what you have done so far - if anything. We don't know what you know, so you may need help installing the JDK. or writing/compiling a "Hello, World" program. We need to know exactly where you are to give you the best help.

think about what you need to to. What are all the little pieces or steps? So for starters, your assignment says to do two things separately.

So the first think I would do is pick ONE to start with, and completely ignore the other. Let assume you want to do the odds first.

Now the problem is easier. So think about that. How would you add up all the odd numbers from 0 to 100? Pretend you are talking to a 10yr old child, giving them directions on how to do it. What would you tell them?

That's how you approach programming problems. You break a large problem down into smaller problems, then you break those down, again, and again, and again...Once you have the smallest steps, you start writing it in code, testing and validating it after adding each new piece.

As Bear says, post what you have done so far - if anything. We don't know what you know, so you may need help installing the JDK. or writing/compiling a "Hello, World" program. We need to know exactly where you are to give you the best help.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors

Esteban Banfield

Greenhorn

Posts: 4

posted 1 year ago

Hey Bear! ok I will.

Im on my work computer ATM and I work for a fed agency so I cant connect my personal laptop to my work wifi... lame, i know.

Bear Bibeault wrote:Welcome to the Ranch, Esteban. Youhavecome to the right place.

To start, please post whatever code you can manage to cobble together as a starting point (please UseCodeTags) and you can get help from there.

Hey Bear! ok I will.

Im on my work computer ATM and I work for a fed agency so I cant connect my personal laptop to my work wifi... lame, i know.

Esteban Banfield

Greenhorn

Posts: 4

posted 1 year ago

@FRED,

You know in my struggles of trying to figure the problem out I told myself, "Let me take this apart and see what I can think up."

So after taking a step back and looking at the problem with fresh eyes ive gathered that you are absolutely right. There are 3 things in this problem that my Prof wants me to do.

-I need to write something that finds the sum of all the even numbers from 0-100

-I need to write something that finds the sum of all the odd number from 0-100

-I need to write something to calculate the difference of both sums

Were currently using Textpad8

fred rosenberger wrote:Also, something everyone needs to learn is that coding is 90% thinking, and 10% typing.

think about what you need to to. What are all the little pieces or steps? So for starters, your assignment says to do two things separately.

So the first think I would do is pick ONE to start with, and completely ignore the other. Let assume you want to do the odds first.

Now the problem is easier. So think about that. How would you add up all the odd numbers from 0 to 100? Pretend you are talking to a 10yr old child, giving them directions on how to do it. What would you tell them?

That's how you approach programming problems. You break a large problem down into smaller problems, then you break those down, again, and again, and again...Once you have the smallest steps, you start writing it in code, testing and validating it after adding each new piece.

As Bear says, post what you have done so far - if anything. We don't know what you know, so you may need help installing the JDK. or writing/compiling a "Hello, World" program. We need to know exactly where you are to give you the best help.

@FRED,

You know in my struggles of trying to figure the problem out I told myself, "Let me take this apart and see what I can think up."

So after taking a step back and looking at the problem with fresh eyes ive gathered that you are absolutely right. There are 3 things in this problem that my Prof wants me to do.

-I need to write something that finds the sum of all the even numbers from 0-100

-I need to write something that finds the sum of all the odd number from 0-100

-I need to write something to calculate the difference of both sums

Were currently using Textpad8

posted 1 year ago

I hope that's a tongue-in-cheek remark. Wireless network security is a major concern anywhere and more so at a Federal government facility. As a student of cybersecurity, you must appreciate the need to restrict network access to only authorized and certified devices, right?

Regarding your programming problem, what kind of looping construct(s) are you familiar with?

Esteban Banfield wrote:

Im on my work computer ATM and I work for a fed agency so I cant connect my personal laptop to my work wifi... lame, i know.

I hope that's a tongue-in-cheek remark. Wireless network security is a major concern anywhere and more so at a Federal government facility. As a student of cybersecurity, you must appreciate the need to restrict network access to only authorized and certified devices, right?

Regarding your programming problem, what kind of looping construct(s) are you familiar with?

*Practice only makes habit, only perfect practice makes perfect.
Practice mindfully by doing the right things and doing things right.*— Junilu

[How to Ask Questions] [How to Answer Questions]

posted 1 year ago

If you think about it a bit more, you'll realize that #1 and #2 are really the same thing...you want to sum up some number from <some lower limit> to <some upper limit>, and you wan to increment by <some amount>. So if you are clever, you can write a method that takes three parameters:

startingValue

upperLimit

incrementAmount

If you write that method, and test the HECK out of it, then #1 and #2 are easy. You'd just call this one method twice, with slightly different parameters. And, then you have a method that can be re-used for a wide variety of circumstances...multiples of 5 from 0 to 10,000. odd numbers from -200 to 17. etc.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors

Esteban Banfield wrote:

So after taking a step back and looking at the problem with fresh eyes ive gathered that you are absolutely right. There are 3 things in this problem that my Prof wants me to do.

-I need to write something that finds the sum of all the even numbers from 0-100

-I need to write something that finds the sum of all the odd number from 0-100

-I need to write something to calculate the difference of both sums

If you think about it a bit more, you'll realize that #1 and #2 are really the same thing...you want to sum up some number from <some lower limit> to <some upper limit>, and you wan to increment by <some amount>. So if you are clever, you can write a method that takes three parameters:

startingValue

upperLimit

incrementAmount

If you write that method, and test the HECK out of it, then #1 and #2 are easy. You'd just call this one method twice, with slightly different parameters. And, then you have a method that can be re-used for a wide variety of circumstances...multiples of 5 from 0 to 10,000. odd numbers from -200 to 17. etc.