Convert Tablespoons to Cups using Programming


This is supposed to convert tablespoons or teaspoons to cup and tell you the remainder. 16 tablespoons in a cup and 48 teaspoons.

public class CookingCalculations {

* Converts tablespoons to cups or teaspoons to cups
* based on user input. If the user enters 1 then the program
* converts tablespoons -> cups. Otherwise it converts
* teaspoons -> cups. It also caluclates the remainder.
* For example, converting 40 tablespoons to cups
* would result in 2 cups and 8 tablespoons.
* @param args User-defined command line arguments (not used).
public static void main(String[] args) {

byte choice, conversionAmount = 0, cups = 0 , remaining = 0;
Scanner userIn = new Scanner(;

System.out.print("Enter 1 to convert tablespoons "
+ "to cups or 2 to convert teapsoon to cups.rn> ");
choice = userIn.nextByte();

System.out.print("Enter the amount you want to convert.rn> ");
conversionAmount = userIn.nextByte();

System.out.print("Enter the amount you entered is equal to "
+ cups + " cups and " + remaining);
if(choice == 1) {
System.out.print(" tablespoons.");
System.out.print(" teapsoon.");


Drop an email to and get instant access to the solution.





  • HWA

    this is a very good website

  • HWA

    I have 50 questions for the same test your page is showing only 28

  • HWA

    hi can you please help or guide me to answer my assignments. thanks

  • HWA

    hi can anyone help or guide me to my assignments. thanks

  • HWA

  • HWA

    This solution is perfect ...thanks

  • HWA

    Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes

  • HWA

    Perfect bank of solution. 

  • HWA

    great !

  • HWA
    Paul Brandon-Fritzius

    thanks for the quick response. the solution looks good. :)

  • HWA
    tina Johnson

    thnx for the answer. it was perfect. just the way i wanted it. 

  • HWA

    works fine.