Gavin Mark
1 Answer(s)      5 years and 9 months ago
Posted in : Java Beginners

Hey my name is Gavin and im a student at school that takes IT. my teacher has gave me a problem and i can't figure it out please help!!!!!!!!

it is a for-loop question:

Display the first 5 multiples of 3 Add all 5 values Calculate the average of the 5 values Print the sum and average

August 17, 2011 at 12:57 PM

class Multiples
{
public static void main(String[] args)
{
int sum=0;
int average=0;
for(int i=1;i<=5;i++){
int multiples=3*i;
sum+=multiples;
}
average=sum/5;
System.out.println("Sum of first 5 multiples of 3: "+sum);
System.out.println("Average of first 5 multiples of 3: "+average);

}
}

please help.. this my importtant project..!!!!!  Consider the Algebra: Solving quadratic equations. The two roots of a quadratic equation ax2 + bx...) Write a Java test program that creates object with a=3, b=4 and c=1. Display
Please help me to modify my java code from php code  i want to covert... help me to convert it into Java. if (request.getParameter("orders") != null... same, as they alter it before. Please help me on this topic "how to order rows
Please Help To Solve My Problem  PHP I Have 6 Textbox and 1 ok button. 6 Textbox to Add the 6 Team Name. Each Team Name In String(Like- A,B,C,D,E,F... Are There Then It's Large Codding So I Need To Help To Another Way To Do
I need help on my Java code.... please please help me out!?  Well my... in the file. Also it should be displayed on the screen. However my code doesn't display the anagram on screen or the output file! Please show me whats wrong. Thanks i
the exact result as the above PHP code is giving. So please help me to convert...Modify Java code from PHP Code  i want to covert this php code int java/JSP. if (isset(\$_POST['orders'])) { \$orders = explode('&', \$_POST
Help me please with my final homework
Help me please with my final homework  Write a Java program of your choice that demonstrates the following concepts: ? Input and Output. ? Selection/Conditional (e.g. if statement). ? Arithmetic. ? Loops. ? Arrays
Not sure whats wrong with my code HELP PLEASE?!?!
Not sure whats wrong with my code HELP PLEASE?!?!  I cant figure out what I am doing wrong in my code can anyone help me out??? Grades function computeGrade( ) { var hw, lab, midt, fin, avg; hw = parseFloat
New to Java Please help  Hi I need help, can some one help me with this. I am currently doing a project. drop me an email to my email address. Thanks!   If you are new in java, then you need to learn core java
Help With My Java Project?
Help With My Java Project?  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower... to put it all together to make it work. please help import
Java Variables Help Please!  Hi, I just started with java and i need help with my school project, this is it so far: import java.util.*; public class ProjectCS { public static void main(String[] args) { welcome
Java Help Please  I can't seem to figure out how to make this program, can some one help me please? It is due soon!! 4) Write a program that will take an input (Date object will contain fields for the month, day, and year - all
please help java  How to Change the background color of the dashboard to black with an opacity of 0.6. Change the opacity of the images in the dashboard to 0.5 before the dashboard slides out. Change the opacity
help please  i wrote this program but the function newLine dosnt work with me and i dont know where is exactly the error this is the code i... on Java visit to : http://www.roseindia.net/java Thanks
help in java please  Define a class named Money whose objects represent amounts of U.S. money. The class will have two instance variables of type int for the dollars and cents in the amount of money. Include a constructor
Help Me in My Java Work
Help Me in My Java Work  Can you help me please... Write a Java application, to be called GpaCalculator, which will return a grade point average (GPA) when given a range of decimal figures representing a selection of exam marks
Help me please!!! - Java Beginners
please help me   I have some error in this programe //write acomputer programe using java to generate following series : //output: //1,2,3,0,-2,7,-4..... class Series1HW { public static void main(String args
please do respond to my problem sooooon sir - Java Beginners
please do respond to my problem sooooon sir  Hello sir, Sir i have... on the link in my browser the link is opened in the internet explorer.i need to open the link also in my own browser.Hope you will help me out.And also sir i need
please help me in a java program !!  the porgram should use kosaraju's algorithm to detect the strong connected components in a graph (http://en.wikipedia.org/wiki/Kosaraju_algorithm) there are 4 classes in my program : Vertex
help please  hi i am done with register application using jsps... shwos some url if copy and paste that url even after i logout from my account still my account opens. I want it to display on homepage or loginpage saying
help please?  Define a class named Circle with the following properties: â?¢ An integer data field named radius with protected access modifier... the properties of both objects and also their surface area and circumference. java
please help me here..  ..uhhmm.. im a little bit new to java and i go confused on my case study.. import java.lang.*; import java.io.*; public... if the first string is part of the second string... ..help..  Hi friend
please help//  Number square cube 1 1 1 3 9 27 5 25 125 7 49 343 9 81 729 total 165 1225 â?? this is the ouput..;;; i