Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners PLEASE HELP WITH MY JAVA
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Gavin Mark
PLEASE HELP WITH MY JAVA
1 Answer(s)      3 years and 2 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

If u can please help...


Advertisement
View Answers

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);

    }
}


Related Tutorials/Questions & Answers:
PLEASE HELP WITH MY JAVA
PLEASE HELP WITH MY JAVA  Hey my name is Gavin and im a student... please help!!!!!!!! it is a for-loop question: Display the first 5 multiples... and average If u can please help...   
please help.. this my importtant project..!!!!!
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
Advertisements
Please help me to modify my java code from php code
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
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!?
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
Please help me to modify my java code from php code
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
java please please help
java please please help  Dear Friends plz help me to complete this program import java.util.*; public class StringDemo { static...[] to HashMap so that i can seperate key and value using Map.Entry.Please help me!  
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
My screen EPAD is broken ...please help
My screen EPAD is broken ...please help   iam in iraq and my screen EPAD is broken ,.please help..can tel me a place to join it to solve this problem ?..Sory
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
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!
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
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
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 - Java Beginners
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
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
this is my javascript code and i am not understanding the mistake in this,please help me?
this is my javascript code and i am not understanding the mistake in this,please help me?  <html> <h2>Form Validation</h2>...; if((nn1.value==null)||(nn1.value=="")){ alert("Please Enter
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
Help me please!!!  im badly needing the complete code for this project in java!!! can you please help me???!!! it is about 1-dimensional array... the answers 8Hours from now!!! Kindly help me!! please!!please!!! NOTE
please help me - 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
please help  please send me the code of dynamic stack in java without using the built in functions
please help me in a java program !! - Java Beginners
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
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?
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.. - Java Beginners
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//
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
please help//
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
please help//
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
help please?
help please?  Define a class named Circle with the following properties: List item ? An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
 

 

 

DMCA.com