Home Answers Viewqa Java-Beginners calculate average

 
 


Bukola Adelakun
calculate average
1 Answer(s)      a year and 3 months ago
Posted in : Java Beginners

  1. Design and write a java program to determine all three digit numbers such that the sum of the cubes of the digits is equal to the original number. abc = a^3 + b^3 + C^3 ( NOTE 407 is one of them)

2.Design and write a program and calculate your final average in this course. The details of the calculating can be found in the course syllabus. Test your program with the following test cases

Test case A: homework/labs 10 10 9 8 10 9 8 10 8.5 6 test scores 88 77

Test case B homework/labs 10 9 0 0 10 9 9 test score 90 70

Test case c

View Answers

February 14, 2012 at 12:53 PM


1)

import java.util.*;
class FindArmstrong
{
    public static void main(String[] args) 
    {

     for(int i=100;i<1000;i++){
         int k=i;
         int n=k;
            int d=0,s=0;
            while(n>0)
            {
            d=n%10;
            s=s+(d*d*d);
            n=n/10;
            }
            if(k==s){
            System.out.println(k);
            }
            else{
            }
        }
    }
}









Related Pages:
calculate average
and write a program and calculate your final average in this course. The details...calculate average   Design and write a java program to determine all three digit numbers such that the sum of the cubes of the digits is equal
calculate average
calculate average  Question 2 cont.d Test case c: home works/labs 10 9 9 9 10 10 9 9 10 10 9 9 10 test scores: 65 89 note, the program should work with different numbers of home works/labs
Calculate sum and Average in java
Calculate sum and Average in java  How to calculate sum and average.... Description:- In this example we are calculating sum and average of n numbers... the sum by the total number of numbers, we have determined the average of numbers
Calculate an average Age of my Class?
Calculate an average Age of my Class?  average age of my class
PHP Get Average - PHP
PHP Get Average  I am writing a method to calculate the average rating of the posted answers? can anyone help me with the method to calculate rating in PHP. In my code, we are providing maximum four options to the user to rate
Average
Average   I have created a file that reads in a text file for a combo box which are exams assignments and quizes. I then have a a textfield..., assignments, etc.) so I can have the average of each item. I then need to graph
SQL Average Count
example ,which helps you to calculate the average count of any records specified... SQL Average Count       Average Count in SQL is used to count the aggregate sum of any field
Highest average score among 25 students
again the grade) calculate average per student and will calculate the highest average among students who should be printed. how can i solve this problem...Highest average score among 25 students  a program that prompts
SQL Average Count
example ,which helps you to calculate the average count of any records specified... SQL Average Count       Average Count in SQL is used to count the aggregate sum of any field
Determine Average by removing Largest and Smallest Number
Determine Average by removing Largest and Smallest Number In this section, you... and then determine the average. For this, an user is allowed to input 10 numbers... into a variable 'sum' which is further used in determining the average. Here is the code
Calculate Company's Sale using Java
Calculate Company's Sales Using Java In this section, you will learn how to calculate Company's sale. A company sales 3 items at different rates and details... of the week c) Average sale per day Here is the code: import java.io.
Student average
to maintain this status is to maintain an average not below 1.8. write a java program... should display the average grade of the student and would display the message...: 1.2 Enter number of units: 1 you got an average of 1.59 congratulation
Class Average Program
condition for sum values. Then calculate the value this method "average... Class Average Program     ... will learn how to use java program for displaying average value. The java instances
Average Age of my Class?
Average Age of my Class?  average age of my class
Having a hard time writing program to calculate test scores..........
into the array. Then calculate and output the following statistics: average score...Having a hard time writing program to calculate test scores..........  i need a program that does this:Standardized Test Scores A local high
sum and average of grades
sum and average of grades  how to print a program which is sum and average of Korean (90), English(85), Mathematics(78), Biology(65), Chemistry(83
how to print the average of each column of 2d n*m array using java
the content of file.now i want to calculate mean(average) of each column present...how to print the average of each column of 2d n*m array using java  here is my code: import java.io.File; import java.io.IOException; import
compute the average of degrees
compute the average of degrees  using c++ language , write a program to do the following 1 enter three degrees of a student by the user . 2 compute the average of his degrees
SQL Average
SQL Average       SQL Average, the part of Aggregate Function. SQL Average is used to compute average value of the records in a table of the database. Understand
Average of Array
Average of Array       In this section, we will learn how to get an average of array. For this, first... that calculates the average of array (result/nums.length). And finally it will display
calculate the time ..
calculate the time ..  [CODE] Elapsed Time Example <script type="text/javascript"> var startTime = null...="button" value="Calculate Difference" onclick="calculateTimeElapsed();" />
MySQL Average Command
MySQL Average Command This example illustrates how to execute the Average command in MySQL. In this example we create a select query to find the average of 'lastAccess' field.   Query  
JPA Avg Function
. This method calculate an average of  given data. JPA Avg() function... the average of product price. For this application, you need the following artifacts
Finding Average in JSP
Finding Average in JSP          In mathematics, an average is a measure of the middle of the data set. The average value is the total amount divided by the total
calculate size of array
calculate size of array  Is it possible to calculate the size of array using pointers in Java
calculate reward points.
calculate reward points.  How to calculate reward points in a multiplex automation system
Mean - average
Java NotesMean - average Computing the arithmetic average (mean) can be done in one pass over all the array elements. //================================================= mean public static double mean(double[] p) { double
How to calculate attending hours?
How to calculate attending hours?  I need to calculate attending hours of a employee in a day in my project to make their monthly salary . By using work starting time and ending time. How should I do it using Date class? Or any
Calculate factorial of a number.
Calculate factorial of a number.  How to calculate factorial of a given number?   import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Factorial { public static
calculate working hour
calculate working hour  why echo not come out? <html><body> <form action="<?php $_SERVER['PHP_SELF'];?>" method="post"> Working hour : <input name="workout" type="text"/><input name="submit1
Calculate Entropy using C++
Calculate Entropy using C++  # include <iostream> # include <cmath> using namespace std; int main() { float S0,S1,S2,S3; float Hs,Hs3; float
how to calculate EMI of the loan
how to calculate EMI of the loan   package carloanapp; import java.io.FileWriter; import java.io.IOException; public class CarLoan { Customer gObjCustomer = null; double gDbRequestedLoanAmount = 0; double
identify the order of the average running time of the method
identify the order of the average running time of the method  public static double getMedian (double[] A) { // given an ordered array of length n, return the median int n = A.length; if ((n % 2) == 1) return A[n/2]; else
how to calculate the price on the option box
how to calculate the price on the option box  How i calculate the value when i using a option box with 2 option..first option i used for product name... to calculate this value
identify the order of growth of the average running time of the method.
identify the order of growth of the average running time of the method.   public static void manypeak (int n, double size) { if (n > 0) manypeak(n/2, size/2); for (int i = 1; i <=n; i++) { drawpeak(size); //method
identify the order of growth of the average running time of the method.
identify the order of growth of the average running time of the method.   public static void manypeak (int n, double size) { if (n > 0) manypeak(n/2, size/2); for (int i = 1; i <=n; i++) { drawpeak(size); //method
calculate difference between two dates
calculate difference between two dates  hi, I was actually working on to calculate the number of days between two dates of dd/mm/yyyy format using javascript. can anyone suggest me how to work it outin calculating
calculate milliseconds to hh mm ss
calculate milliseconds to hh mm ss  how to calculate milliseconds to hh mm ss ? Actually i wanted to calculate week days and hours from milliseconds..?   var seconds = (mil / 1000) | 0; mil -= seconds * 1000; var
Week calculate start from friday
Week calculate start from friday  My problem is to calculate how many weeks have a month. Note that my weeks have to start on Friday! I have three combo boxes. First display year. Second one display month. Third one display
How to calculate area of rectangle
How to Calculate Area of Rectangle       In this section we will learn how to calculate area... rectangle method which takes two parameters of type integer. To calculate the area
how to write weighted moving average code using 2d-array
how to write weighted moving average code using 2d-array  how to write weighted moving average code using 2d-array
how to calculate the employee tax - JSP-Servlet
how to calculate the employee tax  How to calculate the employee tax.Can u please send to me calculation tables
calculate difference between two time in jsp
calculate difference between two time in jsp  How to calculate difference between two dates
Calculate Month Difference in mysql - SQL
Calculate Month Difference in mysql  hi , i am rahul.Can anybody plz help me.i am calculating month difference in mysql5.0 procedure . i have done coding for it. it's counting difference between months. but what i want
how to calculate max and min - RUP
how to calculate max and min  hye!i'm a new for the java and i want to ask a question . Could anyone help me to teach how to calculate the maximum and minimum using java language.  Hi friend, In Math class having two
adding a method to calculate a students grade
adding a method to calculate a students grade  The Following program which displays a students name, id and mark works fine. But when i tried to add a method to display the grade based on the mark of the student i cant seem
JDBC : Salary greater than average salary
JDBC : Salary greater than average salary In this section you will learn how to get records of employee having salary greater than the average salary. Salary greater than average salary : By using AVG(salary) function you can get
How to calculate number of weeks in a specified month
How to calculate number of weeks in a specified month  I am create one program that contain three combo box. 1.cmbyear 2.cmbmonth 3.cmbweek i am select year and month. then automatically calculate number of weeks in a specified
accepts the area of a square and will calculate its perimeter.
accepts the area of a square and will calculate its perimeter.  Develop a program that accepts the area of a square and will calculate its perimeter.   Hi Friend, Try the following code: import java.util.*; import
Calculate factorial Using Recursion
Calculate factorial Using Recursion  ... through this example you will be understand how you can calculate the factorial... to calculate the factorial. The number we have entered in the html page

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.