Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Mysitque
Had anyone had an esophageal manometry?
I hace been suffering from GERD for a couple of years now. I have been put on tons of different meds and have had an upper endoscopy. Now my doc wants to try a manometry to see if I really have reflux or if something else is not functioning properly. I have heard a lot of bad things about the manometry. Should I even bother with it or should I skip the pain and live with the indigestion/hearburn?
1 AnswerOther - Diseases6 years agoFind an nth-degree polynomial function with real coefficients satisfying the given conditions?
N = 4; -2, 5, and 3 + 2i are zeros; f(1) = -96.
The book gives me this as an answer: f(x) = x^4 - 9x^3 + 21x^2 + 21x - 130. However, I need to know how to solve that out and have no clue how it was done. Can someone help me? Thanks!
1 AnswerHomework Help7 years agoIs 103 pounds a good weight for a 5'1" 17 year old female?
6 AnswersDiet & Fitness7 years agoHelp with Algebra 2 problems?
I need help with finding the x intercepts, zeros, or roots of functions. The problems are multiple choice.
1) 5r^2 + 7r - 108 = 0.
A) {-7 + sqrt of 481 / 2, -7 - sqrt of 481 / 2}
B) {7 + sqrt of 481 / 2, 7 - sqrt of 481 / 2}
C) {4, -27/5}
D) {27/5, -4)
I got C as the answer for 1, on the calculator. But, I need to know how to do this by hand.
2) 3x^2 + 3x + 1 = 0.
A) {3 + sqrt of 21 / 6, 3 - sqrt of 21 / 6}
B) {3 + i times sqrt of 15/4, 3 - i times sqrt of 15 / 4}
C) -3 + sqrt of 33 / 4, -3 - sqrt of 33 / 4}
D) -3 + i times sqrt of 3 / 6, -3 - i times sqrt of 3 / 6}
*sqrt = squareroot
If someone could explain how to solve these by hand that would we great!
2 AnswersHomework Help7 years agoWhy do I keep getting chronic headaches?
Everyday, for the past month or two, I have been coming home from school with a headache. It hurts right above my eyebrows. Sometimes it's on one side, sometimes it's on both. The headache usually starts when I'm in math class (which starts at 12:30) but it sometimes starts earlier. They don't seem to go away until I go to bed. I don't know if this has anything to do with it but I wear glasses for distance. I don't wear them all day, only when I really need them (like to see the board). What do these headaches mean and what can I do about them?
2 AnswersPain & Pain Management7 years agoCan my Gateway LT41P06u touchscreen laptop run Combat Arms?
I recently downloaded Combat Arms on my Gateway touch laptop. When I try to run the game, an error pops up. Is it my laptop or is there something I can do to get the game to work? Please help, thanks!
1 AnswerLaptops & Notebooks7 years agoWhy do U.S. textbooks glorify the Alamo and the Gold Rush?
My U.S. History teacher asked us, why do U.S. textbooks glorify the Alamo and the Gold Rush? This was my initial answer that I turned in to him:
"The Alamo is glorified in U.S. textbooks because even though Texas lost the battle, they won the war against Mexico and gained independence. Texas then asked to join the U.S. The U.S. tends to remember and glorify the parts of history that makes us look good rather than stress a loss.
The Gold Rush is glorified in U.S. textbooks because after the gold rush, California became a state. Also, the gold rush stimulated economies around the world. The U.S. likes to take credit for big things, such as boosting economies of other countries."
My teacher said this was a logical answer, but not the correct one. He then asked me to redo my paper and come back with the correct answer. Does anyone have any ideas? Am I completely on the wrong path?
10 AnswersHistory7 years agoPlay your first Call of Duty: Ghosts multiplayer match, then log in again?
I just installed the Call of Duty Ghosts app on my touchscreen laptop, which has windows 8. I created an account and installed the steam app because it said I would need it in order to play. When I go to log in, I get a message that says "Play your first Call of Duty: Ghosts multiplayer match, then log in again." It then sends me back to the original log in screen. How can I play a match if I'm not logged in? Has anyone else has this problem or can someone help me figure this out? Thanks.
2 AnswersVideo & Online Games7 years agoJava Programming BaseballStats.java PLEASE HELP ME WITH THIS PROGRAM IM STUCK?
I have to create a program that prints baseball statistics. Here is the assignment:
Complete the program as follows:
1. First add a while loop that reads each line in the file and prints out each part (name, then each at bat, without the
commas) in a way similar to the URLDissector program in Listing 5.11 of the text. In particular inside the loop you
need to
a. read the next line from the file
b. create a comma delimited scanner (lineScan) to parse the line
c. read and print the name of the player, and finally,
d. have a loop that prints each at bat code.
2. Compile and run the program to be sure it works.
3. Now modify the inner loop that parses a line in the file so that instead of printing each part it counts (separately) the
number of hits, outs, walks, and sacrifices. Each of these summary statistics, as well as the batting average, should
be printed for each player. Recall that the batting average is the number of hits divided by the total number of hits
and outs.
4. Test the program on the file stats.dat and stats2.dat .
Here is the code I have so far:
package Mackenzie;
//****************************************************************
//BaseballStats.java
//Mackenzie Pardoe
// 11/18/13
//Reads baseball data in from a comma delimited file. Each line
//of the file contains a name followed by a list of symbols
//indicating the result of each at bat: h for hit, o for out,
//w for walk, s for sacrifice. Statistics are computed and
//printed for each player.
//****************************************************************
import java.util.Scanner;
import java.io.*;
public class BaseballStats
{
//-------------------------------------------------
//Reads baseball stats from a file and counts
//total hits, outs, walks, and sacrifice flies
//for each player.
//-------------------------------------------------
public static void main (String[] args) throws IOException
{
Scanner fileScan, lineScan;
String fileName, letter, player;
int oCount = 0, hCount = 0, sCount = 0, wCount = 0;
double Avg = 0;
Scanner scan = new Scanner(System.in);
System.out.print ("Enter the name of the input file: ");
fileName = scan.nextLine();
fileScan = new Scanner(new File("stats.dat"));
//Read and process each line of the file
while (fileScan.hasNext())
fileName = fileScan.nextLine();
System.out.println("Player Stats: " + fileName);
System.out.println();
lineScan = new Scanner (fileName);
lineScan.useDelimiter(" , ");
while(lineScan.hasNext())
{
letter = lineScan.next();
System.out.println(letter + " ");
if (letter.equals("h"))
hCount++;
if (letter.equals("s"))
sCount++;
if (letter.equals("o"))
oCount++;
if(letter.equals("w"))
wCount++;
}
Avg = (double)hCount/(hCount + oCount);
System.out.println("Hits: " + hCount + "Walks: " + wCount + "Sacrifices: " + sCount + "Outs: " + oCount);
System.out.println("Batting avergae: " + Avg);
System.out.println();
}
}
This is the output I'm supposed to get:
stats.dat
Willy Wonk,o,o,h,o,o,o,o,h,w,o,o,o,o,s,h,o,h
Shari Jones,h,o,o,s,s,h,o,o,o,h,o,o,o,o
Barry Bands,h,h,w,o,o,o,w,h,o,o,h,h,o,o,w,w,w,h,o,o
Sally Slugger,o,h,h,o,o,h,h,w
Missy Lots,o,o,s,o,o,w,o,o,o
Joe Jones,o,h,o,o,o,o,h,h,o,o,o,o,w,o,o,o,h,o,h,h
Larry Loop,w,s,o,o,o,h,o,o,h,s,o,o,o,h,h
Sarah Swift,o,o,o,o,h,h,w,o,o,o
Bill Bird,h,o,h,o,h,w,o,o,o,h,s,s,h,o,o,o,o,o,o
Don Daring,o,o,h,h,o,o,h,o,h,o,o,o,o,o,o,h
Jill Jet,o,s,s,h,o,o,h,h,o,o,o,h,o,h,w,o,o,h,h,o
stats2.dat
Barry Bands,h,h,w,o,o,o,w,h,o,o,h,h,o,o,w,w,w,h,o,o
If someone could tell me how to write this program, that would be great. I have no clue on what to do and am stuck. I'm not good at programming and just want to get through this assignment. Please help me! Thanks!
1 AnswerProgramming & Design8 years agoJava Programming Shop.java I NEED HELP ASAP!?
I need help completing this program, I am stuck. I am mostly having problems with printing the cart. Here is the assignment:
In this exercise you will implement a shopping cart using the ArrayList class. The file Item.java contains the definition of a
class named Item that models an item one would purchase (this class was used in an earlier lab). An item has a name, price,
and quantity (the quantity purchased). The file Shop.java is an incomplete program that models shopping.
1. Complete Shop.java as follows:
a. Declare and instantiate a variable cart to be an empty ArrayList.
b. Fill in the statements in the loop to add an item to the cart and to print the cart contents (using the default toString in
the ArrayList class). Comments in the code indicate where these statements go.
c. Compile your program and run it.
2. You should have observed two problems with using the default printing for the cart object: the output doesn’t look very
good and the total price of the goods in the cart is not computed or printed. Modify the program to correct these
problems by replacing the print statement with a loop that does the following:
a. gets each item from the cart and prints the item
b. computes the total price of the items in the cart (you need to use the getPrice and getQuantity methods of the Item
class). The total price should be printed after the loop.
3. Compile and run your program.
Here is the driver:
import java.text.NumberFormat;
public class Item
{
private String name;
private double price;
private int quantity;
// ----------------------------------------...
// Create a new item with the given attributes.
// ----------------------------------------...
public Item (String itemName, double itemPrice, int numPurchased)
{
name = itemName;
price = itemPrice;
quantity = numPurchased;
}
// ----------------------------------------...
// Return a string with the information about the item
// ----------------------------------------...
public String toString ()
{
NumberFormat fmt = NumberFormat.getCurrencyInstance();
return (name + "\t" + fmt.format(price) + "\t" + quantity + "\t"
+ fmt.format(price*quantity));
}
// ----------------------------------------...
// Returns the unit price of the item
// ----------------------------------------...
public double getPrice()
{
return price;
}
// ----------------------------------------...
// Returns the name of the item
// ----------------------------------------...
public String getName()
{
return name;
}
// ----------------------------------------...
// Returns the quantity of the item
// ----------------------------------------...
public int getQuantity()
{
return quantity;
}
}
And here is Shop.java
package Mackenzie;
//***************************************************************
//Shop.java
//Mackenzie Pardoe
// 11/13/13
//Uses the Item class to create items and add them to a shopping
//cart stored in an ArrayList.
//***************************************************************
import java.util.ArrayList;
import java.util.Scanner;
public class Shop
{
public static void main (String[] args)
{
ArrayList<Item> cart = new ArrayList<Item>();
Item item;
String itemName;
double itemPrice;
int quantity;
Scanner scan = new Scanner(System.in);
String keepShopping = "y";
do
{
System.out.print ("Enter the name of the item: ");
itemName = scan.nextLine();
System.out.print ("Enter the unit price: ");
itemPrice = scan.nextDouble();
System.out.print ("Enter the quantity: ");
quantity = scan.nextInt();
//*** create a new item and add it to the cart
item = new Item(itemName, itemPrice, quantity);
cart.add(item);
//*** print the contents of the cart object using println
System.out.println("Current items in your cart: " + cart);
System.out.print ("Continue shopping (y/n)? ");
keepShopping = scan.nextLine();
}
while (keepShopping.equals("y"));
}
double finalPrice = 0;
{
for (int i = 0; i<cart.size(); i++)
{
item = cart.get(i);
}
for (Item xitem:cart)
{
}
}
}
I need help ASAP as this is due tomorrow! Please help me I am really stuck. I know there is something wrong with my loop but I don't know how to fix it. Help please! Thanks!
3 AnswersProgramming & Design8 years agoJava Programming Item.java and Shop.java PLEASE HELP?
I need help completing this program, I am stuck. I am mostly having problems with printing the cart. Here is the assignment:
In this exercise you will implement a shopping cart using the ArrayList class. The file Item.java contains the definition of a
class named Item that models an item one would purchase (this class was used in an earlier lab). An item has a name, price,
and quantity (the quantity purchased). The file Shop.java is an incomplete program that models shopping.
1. Complete Shop.java as follows:
a. Declare and instantiate a variable cart to be an empty ArrayList.
b. Fill in the statements in the loop to add an item to the cart and to print the cart contents (using the default toString in
the ArrayList class). Comments in the code indicate where these statements go.
c. Compile your program and run it.
2. You should have observed two problems with using the default printing for the cart object: the output doesn’t look very
good and the total price of the goods in the cart is not computed or printed. Modify the program to correct these
problems by replacing the print statement with a loop that does the following:
a. gets each item from the cart and prints the item
b. computes the total price of the items in the cart (you need to use the getPrice and getQuantity methods of the Item
class). The total price should be printed after the loop.
3. Compile and run your program.
Here is the driver:
import java.text.NumberFormat;
public class Item
{
private String name;
private double price;
private int quantity;
// -------------------------------------------------------
// Create a new item with the given attributes.
// -------------------------------------------------------
public Item (String itemName, double itemPrice, int numPurchased)
{
name = itemName;
price = itemPrice;
quantity = numPurchased;
}
// -------------------------------------------------------
// Return a string with the information about the item
// -------------------------------------------------------
public String toString ()
{
NumberFormat fmt = NumberFormat.getCurrencyInstance();
return (name + "\t" + fmt.format(price) + "\t" + quantity + "\t"
+ fmt.format(price*quantity));
}
// -------------------------------------------------
// Returns the unit price of the item
// -------------------------------------------------
public double getPrice()
{
return price;
}
// -------------------------------------------------
// Returns the name of the item
// -------------------------------------------------
public String getName()
{
return name;
}
// -------------------------------------------------
// Returns the quantity of the item
// -------------------------------------------------
public int getQuantity()
{
return quantity;
}
}
And here is Shop.java
import java.util.ArrayList;
import java.util.Scanner;
public class Shop
{
public static void main (String[] args)
{
ArrayList<Item> cart = new ArrayList<Item>();
Item item;
String itemName;
double itemPrice;
int quantity;
Scanner scan = new Scanner(System.in);
String keepShopping = "y";
do
{
System.out.print ("Enter the name of the item: ");
itemName = scan.nextLine();
System.out.print ("Enter the unit price: ");
itemPrice = scan.nextDouble();
System.out.print ("Enter the quantity: ");
quantity = scan.nextInt();
//*** create a new item and add it to the cart
item = new Item(itemName, itemPrice, quantity);
cart.add(item);
//*** print the contents of the cart object using println
System.out.println("Current items in your cart: " + cart);
System.out.print ("Continue shopping (y/n)? ");
keepShopping = scan.nextLine();
while (keepShopping.equals("y"));
}
double finalPrice = 0;
{
for (int i = 0; i<cart.size(); i++)
{
item = cart.get(i;)
}
for (Item: item cart)
{
}
}
}
If someone could tell me what to do that would be great! I've been stuck for days and this thing is due soon. Thanks!
Programming & Design8 years agoJava Programming Factorials.java PLEASE HELP?
I need to write a java program that calculates the factorial of an entered number. Here are the instructions:
The factorial of n (written n!) is the product of the integers between 1 and n. Thus 4! = 1*2*3*4 = 24. By definition, 0! = 1.
Factorial is not defined for negative numbers.
1. Write a program that asks the user for a non-negative integer and computes and prints the factorial of that integer. You'll
need a while loop to do most of the work—this is a lot like computing a sum, but it's a product instead. And you'll need
to think about what should happen if the user enters 0.
2. Now modify your program so that it checks to see if the user entered a negative number. If so, the program should print a
message saying that a nonnegative number is required and ask the user the enter another number. The program should
keep doing this until the user enters a nonnegative number, after which it should compute the factorial of that number.
Hint: you will need another while loop before the loop that computes the factorial. You should not need to change any
of the code that computes the factorial!
This is the code I have so far:
import java.util.Scanner;
public class Factorials
{
public static void main(String[] args)
{
int integer;
int count, fact = 1;
Scanner scan = new Scanner (System.in);
System.out.println("Please enter a non-negative integer: ");
integer = scan.nextInt();
for (count = 1; count <=integer; count++)
{
fact = fact * count;
System.out.println("The factorial of " + integer + " is " + fact);
if (integer < 0)
System.out.println("The number you entered is not a non-negative number. Please enter another one.");
integer = scan.nextInt();
{
System.out.println("The factorial of " + integer + " is " + fact);
}
}
}
}
When I enter a non-negative integer, the factorial it gives me is incorrect. What am I doing wrong? Please help! Thanks.
Programming & Design8 years agoJava Programming VoteCounter and VoteCounterPanel (Revisited) PLEASE HELP?
The assignment:
Chapter 4 had a lab exercise that created a GUI with two buttons representing two candidates (Joe and Sam) in an election or
popularity contest. The program computed the number of times each button was pressed. In that exercise two different
listeners were used, one for each button. This exercise is a slight modification. Only one listener will be used and its
ActionPerformed method will determine which button was pressed.
The files VoteCounter.java and VoteCounterPanel.java contain slight revisions to the skeleton programs used in the Chapter
4 exercise. Save them to your directory and do the following:
1. Add variables for Sam - a vote counter, a button, and a label.
2. Add the button and label for Sam to the panel; add the listener to the button.
3. Modify the ActionPerformed method of the VoteButtonListener class to determine which button was pressed and
update the correct counter. (See the LeftRight example or the Quote example for how to determine the source of an
event.)
4. Test your program.
5. Now modify the program to add a message indicating who is winning. To do this you need to instantiate a new label,
add it to the panel, and add an if statement in actionPerformed that determines who is winning (also test for ties) and
sets the text of the label with the appropriate message.
My Code:
The driver:
import javax.swing.JFrame;
public class VoteCounter
{
//-----------------------------------------
//Creates the main program frame.
//-----------------------------------------
public static void main(String[] args)
{
JFrame frame = new JFrame("Vote Counter");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new VoteCounterPanel());
frame.pack();
frame.setVisible(true);
}
}
The other code:
import java.awt.*;
import java.awt.event.*;
import javax.swing. *;
public class VoteCounterPanel extends JPanel
{
private int votesForJoe, votesForSam;
private JButton joe, sam, winner;
private JLabel labelJoe, labelSam;
//-------------------------------------------------
//Constructor: Sets up the GUI.
//-------------------------------------------------
public VoteCounterPanel()
{
votesForJoe = 0;
joe = new JButton("Vote for Joe");
joe.addActionListener(new VoteButtonListener());
labelJoe = new JLabel("Votes for Joe: " + votesForJoe);
add(joe);
add(labelJoe);
setPreferredSize(new Dimension(300, 40));
setBackground(Color.cyan);
votesForSam = 0;
sam = new JButton ("Vote for Sam");
sam.addActionListener(new VoteButtonListener());
labelSam = new JLabel("Votes for Sam: " + votesForSam);
add(sam);
add(labelSam);
setPreferredSize(new Dimension(300, 40));
winner = new JButton("The winner is...");
winner.addActionListener(new VoteButtonListener());
add(winner);
setPreferredSize(new Dimension(150, 150));
}
//**************************************************
//Represents a listener for button push (action) events
//**************************************************
private class VoteButtonListener implements ActionListener
{
//----------------------------------------------
//Updates the appropriate vote counter when a
//button is pushed for one of the candidates.
//----------------------------------------------
public void actionPerformed(ActionEvent event)
{
votesForJoe++;
labelJoe.setText("Votes for Joe: " + votesForJoe);
votesForSam++;
labelSam.setText("Votes for Sam: " + votesForSam);
if(event.getSource()==winner){
if(votesForJoe < votesForSam){
JOptionPane.showMessageDialog (null, "Sam wins!");
}
if(votesForSam < votesForJoe){
JOptionPane.showMessageDialog(null, "Joe wins!");
}
if(votesForJoe==votesForSam){
JOptionPane.showMessageDialog(null, "It's a tie!");
}
}
}
}
}
The program runs. However, when I press the button "Vote for Joe" it give one vote for Joe AND Sam. The same thing happens if I press "Vote for Sam." What am I doing wrong? Please help! Thanks!
1 AnswerProgramming & Design8 years agoSquare.java and DrawingSquares.java I need help with my java programs...?
The assignment:
1. Write a class Square that represents a square to be drawn. Store the following information in instance variables:
size (length of any side)
x coord of upper left-hand corner
y coord of upper left-hand corner
color
Provide the following methods:
A parameterless constructor that generates random values for the size, color, x, and y. Make the size between 100
and 200, x between 0 and 600, y between 0 and 400. The squares can be any color—note that you can pass a single
int parameter to the Color constructor, but it will only consider the first 24 bits (8 bits for each of R, G, B
component).
IMPORTANT: Your random number generator must be declared at the class level (not inside the constructor), and
must be declared static. So its declaration and initialization should appear with the declarations of size, color, x, and
y, and should look like this:
private static Random generator = new Random();
A draw method that draws the square at its x,y coordinate in its color. Note that you need a Graphics object, like the
page parameter of the paint method, to draw. Your draw method should take a Graphics object as a parameter.
2. Now write an applet DrawSquares that uses your Square class to create and draw 5 squares. This code should be very
simple; the paint method will simply create a Square and then draw it, repeated 5 times. Don’t forget to pass the
Graphics object to draw.
My Code:
Square.java (The driver)
package Mackenzie;
//****************************************************
// Square.java
// Mackenzie Pardoe
// 10/28/13
//****************************************************
import java.awt.*;
import javax.swing.*;
import java.util.Random;
public class Square
{
private int size;
private int x;
private int y;
private Color color;
private int a1, a2, a3;
private static Random generator = new Random();
public Square(){
size = generator.nextInt(51) + 50;
x = generator.nextInt(301);
y = generator.nextInt(301);
a1 = generator.nextInt(256);
a2 = generator.nextInt(256);
a3 = generator.nextInt(256);
color = new Color(a1, a2, a3);
}
public void draw(Graphics pen)
{
pen.setColor(color);
pen.fillRect(x, y, size, size);
}
}
DrawingSquares.java
package Mackenzie;
//*******************************************************
// DrawSquares.java
// Mackenzie Pardoe
// 10/28/13
//*******************************************************
import java.awt.*;
import javax.swing.*;
public class DrawSquares extends JApplet {
public int i;
Square[] square;
public void init(){
square = new Square[5];
for(int i = 0; i < square.length; i++);
square[i] = new Square();
}
public void paint(Graphics g) {
super.paint(g);
for(int i = 0; i < square.length; i++);
square[i].draw(g);
}
}
It's supposed to draw five squares and every time you move the applet window, it is supposed to continue to draw 5 squares. Can you tell me what I'm doing wrong?
Thanks.
1 AnswerProgramming & Design8 years agoI feel fat but don't look fat?
I'm 16 and I'm 5'1" and weigh 104 pounds. When I look in the mirror, I don't think I look fat at all. But, sometimes I feel much heavier than I actually am. Sometimes I even feel fat after I eat (junk food). Is it just my mind tricking me?
2 AnswersDiet & Fitness8 years agoJava Programming - Base Conversion...PLEASE HELP!?
I am new to Java Programming and have no clue what I'm doing. I have an assignment that involves base converting. I really need help getting started because I don't even understand the instructions. Here is the assignment:
Base Conversion
One algorithm for converting a base 10 number to another base b involves repeatedly dividing by b. Each time a division is
performed the remainder and quotient are saved. At each step, the dividend is the quotient from the preceding step; the
divisor is always b. The algorithm stops when the quotient is 0. The number in the new base is the sequence of remainders in
reverse order (the last one computed goes first; the first one goes last).
In this exercise you will use this algorithm to write a program that converts a base 10 number to a 4-digit number in another
base (you don't know enough programming yet to be able to convert any size number). The base 10 number and the new base
(between 2 and 9) will be input to the program. The start of the program is in the file BaseConvert.java. Save this file to your
directory, then modify it one step at a time as follows:
1. The program will only work correctly for base 10 numbers that fit in 4 digits in the new base. We know that in base 2 the
maximum unsigned integer that will fit in 4 bits is 11112 which equals 15 in base 10 (or 24 – 1). In base 8, the maximum
number is 77778 which equals 4095 in base 10 (or 84 – 1). In general, the maximum base 10 number that fits in 4 base b
digits is b4 – 1. Add an assignment statement to the program to compute this value for the base that is input and assign it
to the variable maxNumber. Add a statement that prints out the result (appropriately labeled). Compile and run the
program to make sure it is correct so far.
2. Now add the code to do the conversion. The comments below guide you through the calculations—replace them with the
appropriate Java statements.
// First compute place0 -- the units place. Remember this comes
// from the first division so it is the remainder when the
// base 10 number is divided by the base (HINT %).
// Then compute the quotient (integer division / will do it!) -
// You can either store the result back in base10Num or declare a
// new variable for the quotient
// Now compute place1 -- this is the remainder when the quotient
// from the preceding step is divided by the base.
// Then compute the new quotient
// Repeat the idea from above to compute place2 and the next quotient
// Repeat again to compute place3
3. So far the program does not print out the answer. Recall that the answer is the sequence of remainders written in reverse
order— note that this requires concatenating the four digits that have been computed. Since they are each integers, if we
just add them the computer will perform arithmetic instead of concatenation. So, we will use a variable of type String.
Note near the top of the program a variable named baseBNum has been declared as an object of type String and
initialized to an empty string. Add statements to the program to concatenate the digits in the new base to baseBNum and
then print the answer. Compile and run your program. Test it using the following values: Enter 2 for the base and 13 for
the base 10 number—the program should print 1101 as the base 2 value; enter 8 for the base and 1878 for the number—
the program should print 3526 for the base 8 value; enter 3for the base and 50 for the number—the program should print
1212.
If someone could help me get started, that would be great. I need the help ASAP. Thanks. :)
4 AnswersProgramming & Design8 years agoJava Programming - Calculating Weight....PLEASE HELP?
I am new to Java Programming and have no clue what I am doing. I have an assignment that I need help with. It involves scanning and I'm not good at getting the program to scan exactly what I want. So here's the assignment:
Ideal Weight
Write a program to compute the ideal weight for both males and females. According to one study, the ideal weight for a
female is 100 pounds plus 5 pounds for each inch in height over 5 feet. For example, the ideal weight for a female who is 5'3"
would be 100 + 15 = 115 pounds. For a male the ideal weight is 106 pounds plus 6 pounds for each inch in height over 5 feet.
For example, the ideal weight for a male who is 6'2" would be 106 + 14*6 =190 pounds. Your program should ask the user
to enter his/her height in feet and inches (both as integers—so a person 5'3" would enter the 5 and the 3). It should then
compute and print both the ideal weight for a female and the ideal weight for a male. The general outline of your main
function would be as follows:
Declare your variables (think about what variables you need—you need to input two pieces of information (what?), then
you need some variables for your calculations (see the following steps)
Get the input (height in feet and inches) from the user
Compute the total number of inches of height (convert feet and inches to total inches)
Compute the ideal weight for a female and the ideal weight for a male (here you basically convert the "word" description
above to assignment statements)
Print the answers
Plan your program, then type it in, compile and run it. Be sure it gives correct answers.
Enhance the Program a Bit The weight program would be a bit nicer if it didn't just give one number as the ideal weight for
each sex. Generally a person's weight is okay if it is within about 15% of the ideal. Add to your program so that in addition to
its current output it prints an okay range for each sex—the range is from the ideal weight minus 15% to the ideal weight plus
15%. You may do this by introducing new variables and assignment statements OR directly within your print statements.
If I could get help with setting up the variables and creating the equations and statements, I may be able to figure out the rest. Thanks.
2 AnswersProgramming & Design8 years agoShould I dye my hair bright blonde and dye the underneath black?
My natural hair color is dirty blonde. All the girls at school are dying the top of their hair bright blonde, and the underneath black. It looks really good on them, and I was wondering if I should try it? Or should I just dye my whole head bright blonde?
8 AnswersHair8 years agoHow is phosphorus released from marine sediment?
I am doing a project on the Phosphorus Cycle. One of the questions I need to answer is "How is phosphorus released from marine sediment?" I could not find an answer anywhere on the web. I was hoping that maybe somebody already has the knowledge. I need the answer ASAP! Thanks.
2 AnswersBotany8 years agoHow do I find the value of a circle if it is a positive number?
I have a geometry assessment I need to complete as homework. There is one question I do not understand. It says, the center of the circle is the origin. The radius of a circle is 25 units. The coordinates of one point on the circle are (15, y). Find the value if it is a positive number. If someone could give me the answer and explain it to me, or at least give me the steps on how to solve this problem, that would be great. Thanks!
2 AnswersMathematics8 years ago