calculate average

calculate average

  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 Tutorials/Questions & Answers:
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
Advertisements
How to calculate the average in Hibernate?
How to calculate the average in Hibernate?  Hi, I have to calculate the average in Hibernate. How to calculate the average in Hibernate? Thanks... of calculating the average on the fee field in database: Projections.avg("fee
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
How to calculate average of array in Java?
How to calculate average of array in Java?  Hi, I have an integer array and I want to calculate the average of the values in it. How to calculate average of array in Java? Thanks   Hi, You can iterate through
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
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
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
Average Age of my Class?
Average Age of my Class?  average age of my class
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
ModuleNotFoundError: No module named 'average'
ModuleNotFoundError: No module named 'average'  Hi, My Python... 'average' How to remove the ModuleNotFoundError: No module named 'average... to install padas library. You can install average python with following command
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
Hibernate criteria average Example
Hibernate criteria average Example   How to find the average in Hibernate? Thanks   Example of finding average on a filed in Hibernate using criteria. For this you have to use Projections.avg() in your program. Check
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
calculate the time ..
calculate the time ..  [CODE] Elapsed Time Example <script type="text/javascript"> var startTime = null...="button" value="Calculate Difference" onclick="calculateTimeElapsed();" />
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
SQL Average Count
demonstrative example ,which helps you to calculate the average count of any... SQL Average Count       Average Count in SQL is used to count the aggregate sum of any field
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 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
ModuleNotFoundError: No module named 'calculate'
ModuleNotFoundError: No module named 'calculate'  Hi, My Python... 'calculate' How to remove the ModuleNotFoundError: No module named 'calculate' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'average-pixels'
ModuleNotFoundError: No module named 'average-pixels'  Hi, My... named 'average-pixels' How to remove the ModuleNotFoundError: No module named 'average-pixels' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-average'
ModuleNotFoundError: No module named 'django-average'  Hi, My... named 'django-average' How to remove the ModuleNotFoundError: No module named 'django-average' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'average-pixels'
ModuleNotFoundError: No module named 'average-pixels'  Hi, My... named 'average-pixels' How to remove the ModuleNotFoundError: No module named 'average-pixels' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Dice-Average'
ModuleNotFoundError: No module named 'Dice-Average'  Hi, My Python... 'Dice-Average' How to remove the ModuleNotFoundError: No module named 'Dice-Average' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-average'
ModuleNotFoundError: No module named 'django-average'  Hi, My... named 'django-average' How to remove the ModuleNotFoundError: No module named 'django-average' error? Thanks   Hi, In your python
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.  ADS_TO_REPLACE_1 Query
Code to calculate hair density
Code to calculate hair density  Hello, Would you please give me a code to calculate the hair density on scalp from image in java
calculate sum of individual digit
calculate sum of individual digit   How calculate product of first and last digit of indiviual numbers Like a=43278 4*8=32
array average across column
array average across column  How can I find the overall averages of the columns in this array? when i run my code it gives me an output that looks like this (showing me wrong averages): How can I find the overall averages
calculate sum of individual digit
calculate sum of individual digit  Hi How to calculate product of first snd last digit of indiviual digit Like Num=23456 S=2*6
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
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
How to calculate days in a year
How to calculate days in a year  Hi, How to calculate no of days in a year? I want a program that calculates no of days in a year by specifying year a parameter. Thanks   Hi, Please check the thread example
SQL Average Count
illustrate an simple demonstrative example ,which helps you to calculate the average... SQL Average Count       Average Count in SQL is used to count the aggregate sum of any field
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
ModuleNotFoundError: No module named 'average-decision-ordering'
ModuleNotFoundError: No module named 'average-decision-ordering'  Hi...: No module named 'average-decision-ordering' How to remove the ModuleNotFoundError: No module named 'average-decision-ordering' error? Thanks  
ModuleNotFoundError: No module named 'average-n-numbers-calvine'
ModuleNotFoundError: No module named 'average-n-numbers-calvine'  Hi...: No module named 'average-n-numbers-calvine' How to remove the ModuleNotFoundError: No module named 'average-n-numbers-calvine' error? Thanks  
ModuleNotFoundError: No module named 'average-decision-ordering'
ModuleNotFoundError: No module named 'average-decision-ordering'  Hi...: No module named 'average-decision-ordering' How to remove the ModuleNotFoundError: No module named 'average-decision-ordering' error? Thanks  
ModuleNotFoundError: No module named 'average-n-numbers-calvine'
ModuleNotFoundError: No module named 'average-n-numbers-calvine'  Hi...: No module named 'average-n-numbers-calvine' How to remove the ModuleNotFoundError: No module named 'average-n-numbers-calvine' error? Thanks  
calculate a list of products
calculate a list of products  Hi can you help me with this java program. This program should allow the user to order from a small catalogue of three items displayed on the screen, then calculate the user's final bill, including
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
ModuleNotFoundError: No module named 'date_calculate'
ModuleNotFoundError: No module named 'date_calculate'  Hi, My... named 'date_calculate' How to remove the ModuleNotFoundError: No module named 'date_calculate' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'latimes-calculate'
ModuleNotFoundError: No module named 'latimes-calculate'  Hi, My... named 'latimes-calculate' How to remove the ModuleNotFoundError: No module named 'latimes-calculate' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'latimes-calculate'
ModuleNotFoundError: No module named 'latimes-calculate'  Hi, My... named 'latimes-calculate' How to remove the ModuleNotFoundError: No module named 'latimes-calculate' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'latimes-calculate'
ModuleNotFoundError: No module named 'latimes-calculate'  Hi, My... named 'latimes-calculate' How to remove the ModuleNotFoundError: No module named 'latimes-calculate' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'ybc-calculate'
ModuleNotFoundError: No module named 'ybc-calculate'  Hi, My... 'ybc-calculate' How to remove the ModuleNotFoundError: No module named 'ybc-calculate' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'calculate-distributions'
ModuleNotFoundError: No module named 'calculate-distributions'  Hi...: No module named 'calculate-distributions' How to remove the ModuleNotFoundError: No module named 'calculate-distributions' error? Thanks   
ModuleNotFoundError: No module named 'calculate-expression'
ModuleNotFoundError: No module named 'calculate-expression'  Hi...: No module named 'calculate-expression' How to remove the ModuleNotFoundError: No module named 'calculate-expression' error? Thanks   Hi

Ads