Skip to content

Programming by Design

If you're not prepared to be wrong, you'll never come up with anything original. – Sir Ken Robinson

  • About
  • Java-PbD
  • C-PbD
  • ASM-PbD
  • Algorithms
  • Other

CISS-111 Project 1

Posted on December 3, 2015February 3, 2025 By William Jojo
CISS-111-Project
Project 1

Write a Java program to demonstrate using command line arguments to convert numeric quantities with a certain radix (counting base) to base ten numbers. You will employ the use of String methods indexOf() and substring() as well as the overloaded Integer method parseInt().

Take a look at the documentation on how to pass command line arguments in IntelliJ. Other IDEs have similar capabilities.


Learning outcomes

  • Working with command line arguments.
  • Exposure to rudimentary parsing principles.
  • Working with String methods.
  • Working with Integer.parseInt().
  • Confirmation program produces desired results.

The strings in args will be the form “value:radix” where the value is expressed with digits appropriate to the radix. So “16384:10” is 16384 as a base 10 number.

Use indexOf() to find the colon and gather the number and the radix using substring(). These values can be used to make a call to parseInt() to convert the numbers to base 10.

Important Note!
You are NOT allowed to use the split() method for this project.

If the provided command line arguments were:

4eb:16 10110110:2 407:8 2048:10

Output should be similar to:

4eb base 16 is 1259 base 10
10110110 base 2 is 182 base 10
407 base 8 is 263 base 10
2048 base 10 is 2048 base 10

Extra Credit!

2 points for detecting a missing colon.
3 points for trapping conversion errors (Chapter 12 – Exceptions)


Submit the project to the Learning Management System as Project1_lastname.java.

Post navigation

❮ Previous Post: CISS-111 Project 3
Next Post: VMware Network Details for CISS-125 ❯

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright © 2018 – 2025 Programming by Design.