TRENDING NEWS

POPULAR NEWS

Need Help With Programming

Java programming, I need help?

public class Mouse {
private int numTeeth;
private int numWhiskers;
private int weight;
public Mouse(int weight) {
this(weight, 16); // calls constructor with 2 parameters
}
public Mouse(int weight, int numTeeth) {
this(weight, numTeeth, 6); // with 3 parameters
}
public Mouse(int weight, int numTeeth, int numWhiskers) {
this.weight = weight;
this.numTeeth = numTeeth;
this.numWhiskers = numWhiskers;
}
public void print() {
System.out.println(weight + " " + numTeeth + " " + numWhiskers);
}
public static void main(String[] args) {
Mouse mouse = new Mouse(15);
mouse.print(); // 15 16 6
}}

I dont understand how it works i got confused ,why the answers are 15 16 6

More need for help with Programming logic?

Design a program that generates a 7-digit lottery number. THe program should have an Integer array with 7 elements. Write a loop that steps through the array, randomly generating a number in the range of 0 through 9 for each element. (Use a random function) Then write another loop that displays the contents of the array.

JAVA programming. I really need help.?

This is my assignment . . .

Write a program that determines the number of consonants, vowels, punctuation characters, and spaces in an input line.

Read in the line into a String (in the usual way). Now use the charAt() method in a loop to access the characters one by one.

Use a switch statement to increment the appropriate variables based on the current character. After processing the line, print out the results.

How do I tell the program to determine if a character is a consonant, vowel, etc. ? Please help.

Linear Programming NEED HELP!!!?

There's no reason why you need to call them "x" and "y", of course, but in this case, what you're trying to find is the number of each kind of pill. So we can define:

x = number of red pills
y = number of blue pills

The objective function is what you want to maximise or minimise. In this case, it's the total cost:

f(x,y) = 0.1 x + 0.2 y

Now, the constraints. First off, there are the common-sense constraints. It's impossible to take a negative number of pills. Hence:

x ≥ 0
y ≥ 0

Then, there are the amounts of each vitamin to consider.

Taking vitamin A to start with, you need at least 38 units. Taking x red pills and y blue pills gives you 6x + 4y units of vitamin A. Therefore:

6x + 4y ≥ 38

And similarly:

x + y ≥ 9
2x + 5y ≥ 27

That's the problem in a nutshell.

It looks like you're solving this graphically (rather than, say, using the simplex method), so the next step is to plot the lines:

x = 0
y = 0
6x + 4y = 38
x + y = 9
2x + 5y = 27

If you graph all of these lines and show the feasable region, you'll find that the points of intersection along the edge are:

Point 1 is the solution of:

x = 0
6x + 4y = 38

i.e. x=0, y=19/3

Point 2 is the solution of:

6x + 4y = 38
x + y = 9

i.e. x=1, y=8

Point 3 is the solution of:

x + y = 9
2x + 5y = 27

i.e. x=6, y=3

Point 4 is the solution of:

2x + 5y = 27
y = 0

i.e. x=27/2, y=0

Evaluate the objective function at these four points, and see what you get.

If I'm understanding the question correctly, there is no "maximum" in this problem: You could buy a million of each kind of pill each day and satisfy the constraints. It just wouldn't minimise costs to do so.

I need help writing a program for C++, can anyone help?

You can try asking for help in exchange of some bucks at Upwork, the world's largest online workplace or Fiverr: The marketplace for creative & professional services.

Need help with experienced c++ programming.?

okay this is what i have

#include
#include
#include
#include
using namespace std;

const int reg=10;
const int can=20;
void candTotal(int totals[], int candidates, int regions,int in[can][reg])
{
for (int i = 0;i {
cout << i;

int total = 0;
for (int j=0; j {
total = total + in[i][j];
}
totals[i] = total;
}
}

int main()
{
ifstream infile; // input file stream
string fname; // file name
int x, y; // to read input data item
int cnt; // counts no. of input data items

int candidates;
int regions;
int in[can][reg];

//open input file for reading
cout << "Enter input file name: ";
cin >> fname;
infile.open(fname.c_str());
if(!infile)
{
cerr << "Error: Can't open input file." << endl;
return 1;
}

// read data items from input file and store them in array
cout << setw(40) <<"Votes" << endl;
int Region;
infile >> Region;

for(int i = 0; i < Region; ++i)
{
cout << "Region " << setw(2) << i + 1<< "\t";
}

cout << endl;

for(int i = 0; i < Region; ++i)
{
cout << "----------";
cout << "\t";
}
cout << endl;

infile >> regions;
infile >> candidates;
int info[candidates][regions];
int c, r, v;
while(infile)

{
infile >> c >> r >> v;
in[c-1][r-1] = v;
}
int totals[candidates];
candTotal(totals,regions, candidates, in);

infile.close();

return 0;
}


okay, now this compiles but i need it to look like this.

http://boole.cs.atu.edu/~nezu/2203/p01.pdf

im sure that its not very far away from complete but just cant find the right way to get it done. Please Help fast if possible give me a call 479 970 2509

Need HELP with LINEAR PROGRAMMING problem?

Set two variables, one for the gallons of the garlic dressing (G), and one of the gallons of the tofu dressing (T). Now set up one inequality for the total amount of oil used, and one for the total amount of vinegar used.

For example, every quart of garlic dressing needs 2 quarts of oil, and every gallon of the tofu dressing requires 3 quarts of oil. So the total amount of oil used is 2G + 3T. This must be less than or equal to 18, the total quarts of oil Jim has to work with. You can set up a similar inequality for the vinegar.

Also, set up an expression for the profit, which is the expression to maximize. And of course, G > 0 and T > 0, so there are two more inequalities.

I need help with programming. I am from India, Mumbai. I have many ideas but not a coder to execute it. I am 17 y/o (Bill Gates was 19) for a revolutionary idea. Where can I find a good programmer in C, C++, Java, Python (think so), and HTML5?

No money business please. The money business will be decided after the product is launched, no expectations, don't expect lakhs from me for hiring you. Work is more but the equity after success will be yours more than only 1%. So think twice. No work is waste just not every worker gets money.

TRENDING NEWS