So, I have a couple of questions that I tried solving, and I wanted a heads up on how I should start, cause I have NO clue. Help me out?
Write a program that invites the user to input an IP number in the dotted decimal notation, and your program then computes and outputs the same IP number in the decimal notation on the screen. For example, if the user inputs the IP number 134.115.64.1, your program should output its decimal notation 2255699969. Your program should repeatedly ask the user to input the next IP number until the user wants to end. You may use the following formula to convert from the dotted decimal notation to decimal notation:
assume the IP number in the dotted decimal notation is a.b.c.d, where a, b, c, and d are decimal numbers between 0 and 255, the corresponding decimal number would be
(((a x 256) + b) x 256 + c) x 256 + d
Your program should check to make sure that the number the user typed in is a legitimate IP number. For instance, a number such as 136.301.44.240 is not a legitimate IP number because the second decimal, 301, is over 255. You should also design a sensible way for the user to signal the end of the
program (such as by typing the word “end”). Please note that there are no “negative” IP numbers. Therefore a number like -2299778952 is not an
accepted notation for any IP number. The program should be well-structured and should have a reasonable set of methods in addition to the
main method. It should use a good coding style, proper indentation, meaningful identifiers and appropriate comments throughout.
I can do this in one class or separate classes, doesn't matter.
I need a head start as soon as possible, have this due in less than 3 days!
Write a program that invites the user to input an IP number in the dotted decimal notation, and your program then computes and outputs the same IP number in the decimal notation on the screen. For example, if the user inputs the IP number 134.115.64.1, your program should output its decimal notation 2255699969. Your program should repeatedly ask the user to input the next IP number until the user wants to end. You may use the following formula to convert from the dotted decimal notation to decimal notation:
assume the IP number in the dotted decimal notation is a.b.c.d, where a, b, c, and d are decimal numbers between 0 and 255, the corresponding decimal number would be
(((a x 256) + b) x 256 + c) x 256 + d
Your program should check to make sure that the number the user typed in is a legitimate IP number. For instance, a number such as 136.301.44.240 is not a legitimate IP number because the second decimal, 301, is over 255. You should also design a sensible way for the user to signal the end of the
program (such as by typing the word “end”). Please note that there are no “negative” IP numbers. Therefore a number like -2299778952 is not an
accepted notation for any IP number. The program should be well-structured and should have a reasonable set of methods in addition to the
main method. It should use a good coding style, proper indentation, meaningful identifiers and appropriate comments throughout.
I can do this in one class or separate classes, doesn't matter.
I need a head start as soon as possible, have this due in less than 3 days!