Archive for the ‘using statement’ Category

How do I write a statement in dos using shell script to display a word?

April 16, 2010 - 11:14 am 2 Comments

I want to write a shell script in dos to display the word "Hello"

use the ECHO command:
echo Hello
or
@echo Hello
(@ keeps the command line from printing out)
"echo" with a dot:
echo.
displays a blank line
you can also add
pause>nul
to keep the shell script from closing (until a key is pressed)
so the ideal script would look something like:

@echo Hello
@pause>nul

or

@echo off
echo Hello
pause>nul

How do I reduce this statement using boolean algrebra?

April 8, 2010 - 3:18 pm 2 Comments

F = BD’+A’D+BC’+A’B+C’D

Boolean algebra is way to complicated use K- mapping 10 times easier…

how should i start my essay off using thesis statement o on i know the caged bird sings?

January 23, 2010 - 9:49 am 1 Comment

i really need this grade im a young black girl trying get through high school please help

Perfect. Use your own experience. You are trying to break out and so is the bird. The poem is about frustration which you understand. Something along the lines of As a young black girl struggling to finish school in the 21st century, I can relate to the frustration the author wrote about in the nineteenth century.

How do you generate a 10×10 multiplication table in C# using looping statement.?

December 24, 2009 - 9:51 pm 1 Comment


I hope this link will help you,
http://answers.yahoo.com/question/index?qid=20071022174321AAkg7g5

other links:
http://www.dreamincode.net/forums/showtopic48548.htm

AP World History I need a thesis statement using the factors (SPRITEE) COmparing the Aztecs and the Incas?

December 9, 2009 - 4:27 pm 1 Comment

Thesis statement: CCT Aztec & Incan civilizations.

thats the prompt.. i need to incorportate it using the AP World rubric that goes like "when comparing this to this between this and this using this factor etc etc"

can anyone who has taken the AP World Class develop a good thesis statement with good description and factors comparing the Aztec and Inca Civilizations

You might say something like:

"Although they resided in separate areas of the hemisphere, spoke different languages, and used different ways of record-keeping, the Aztecs and the Inca were two branches off the same Native American tree, based on corn civilization, astronomy, and collectivism."

how to Write a program using switch statement that will examine the value of an integer?

November 14, 2009 - 10:49 pm 1 Comment

Use break statement after every case statement

int value;
switch(value)
{
case 1:
//your code
break;
case 2:
//your code
break;

default:
//your code
break;
}

How to implement switch statement using string?

November 12, 2009 - 2:14 am 2 Comments

I want to implement a switch statement for a string, which varies from time to time (depending on the input) given at runtime. how can i use it using stls?

Give more description avout which language u r using and what actually u want to achive.

How to code the encryption code in java using a For loop statement?

November 9, 2009 - 12:48 am 1 Comment

I want to write a character encryption program that has to take an input,encrypt it and display the encrypted output.

Hint: A = @
B = a
C = b
D = c
E = d

eg: input = Hello World
output = gdkkn vnqkc

import org.apache.commons.lang.StringUtils;
public class Test {
public static void main(String[] args) {
String s = "Hello World";
StringBuffer output = new StringBuffer();
s = StringUtils.lowerCase(s);
for (int i=0; i < s.length() ; i++){
char c = s.charAt(i);
int charCode = (int) c;
charCode–;
output.append((char) charCode);
}

System.out.println("Output = " + output);
}
}

Write a program that asks the user to enter a number within the range of 1 through 10 Using a switch statement?

November 3, 2009 - 8:54 am 1 Comment

Write a program that asks the user to enter a number within the range of 1 through 10. Using a switch statement to display the Roman numeral version of that number.

something like

get number
case 1
print I
break
case 2
print II
break
case 3
print IIII
break
case 4
print IV
break
case 5
print V
break
case 6
print VI
break
case 7
print VII
break
case 8
print VIII
break
case 9
print IX
break
case 10
print X
break
default
print INVALID ENTRY!
break

How would i move multiple objects at the same time in java using a for statement?

October 31, 2009 - 9:17 pm 2 Comments

Ok its a really simple assignment. ive had to make an image comprising of three shapes, Circle,Square,Triangle. i decided to make a boat which floats across the page left to right and then from right to left.
the boat is comprised of 4 separate Squares which are all different objects, and a triangle.
when i run the code the objects take it in turn to move, however i want them all to move together. so all of the shapes that make the boat move in sync.
Hope thats a bit more clear?

I don’t understand. "Move" an object? Can you explain more please. The for construct simply indicates the the code inside its braces with repeat x amount of times. e.g.

for(int x = 0; x < 10; x++){ System.out.println("*");}

x controls how many times the code inside the braces will run.

I saw your last question. You’ve still failed to go to into detail. What is the nature of the assignment? Post some more information, instead of asking vague inquiries. Good luck.

See Rectangle2D for geometric objects. Also, the Graphics2D for the draw(Shape s) method. You’ll also need to know how to use Threads and some simple swing concepts. It would take a miracle to teach you what’s needed online. I suggest you check out Sun’s tutorials for Java programming. They’ve got everything you need, plus example using Swing and Threads.

important methods:

Rectangle2D.setFrame(double d1, double d2, …, ….)
Graphics2D.setColor(Color c);
Graphics2D.draw(Shape s);

Simple example:

class Example {
public static void main(String… args) {
Rectangle2D[] shapes = new Rectangle2D[5];
Canvas c = new Canvas(shapes);
JFrame f = new JFrame().add(c);
//set size and set visible here
new drawThread(c);
}
}

class Canvas extends JPanel {
Canvas(Rectangle2D[] shapes){super();
//set Frame for all shapes
}
//override paintComponent(); required of all swing apps
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.setColor(Color.RED);
for(Rectangle2D r : shapes) {g2d.draw(r);}
}
}
class drawThread extends Thread {
drawThread(JPanel canvas){ super(); this.start(); }
public void run() {
while(true) {
//change the frame of the geometric objects, move it
try{Thread.sleep(5000);}catch(Exception){}
canvas.repaint(); //calls paintComponent() on JPanel
}
}
}

That’s about half your project. Get crackin’ baby….