SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 209 Weeks Ago, 3 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 07 Jan 2018 My Price 10.00

"CANDYCALCULATOR.JAVA" is a solution for a previous

Hi. So I am stuck in this problem for Java. The attachment named "CANDYCALCULATOR.JAVA" is a solution for a previous problem. And Problem 5 and 6 (From the Image) is a continuation the code. I tried to solve No.5 but something is there that I am doing wrong. if you could solve it, that would be great. 

  • /************************************************************/
    /*Program: Harris-Benedict Equation BMR                     */
    /*CIS150AB                                                  */
    /*Istiaque Ali Chowdhury                                    */
    /*2/21/2017                                                 */
    /************************************************************/

    import java.util.Scanner;

    public class CandyCalculator
    {
       public static void main(String[] args)
       {
          Scanner keyboard = new Scanner(System.in);
          int age;
          int weight;
          int height;
          String gender;
         
          System.out.println("This program will calculate the number of 230 calorie candy bars to consume to maintain your weight.");
          System.out.println("What is your age in years?");
          age = keyboard.nextInt();
          System.out.println("What is your weight in pounds?");
          weight = keyboard.nextInt();
          System.out.println("What is your total height in inches?");
          height = keyboard.nextInt();
          System.out.println("Please specify your gender, M/W?");
          gender = keyboard.nextLine();


         
          double caloriesMale, caloriesFemale;
         
          caloriesFemale = 655 + (4.3*weight) + (4.7*height) - (4.7*age);
          caloriesMale = 66 + (6.3*weight) + (12.9*height) - (6.8*age);
          if(gender = 'M')
         
          {System.out.println("A male with those measurements should eat " +
                      (caloriesMale / 230) +
                      " candy bars per day to maintain his weight.");}

    else

                                 

    {System.out.println("A female with those measurements should eat " +
                      (caloriesFemale / 230) +
                      " candy bars per day to maintain her weight.");
    }
       }
                     
    }
      

Attachments:

Answers

(5)
Status NEW Posted 07 Jan 2018 01:01 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)