java :
Given an int variable n that has been initialized to a positive
value and, in addition, int variables k and total that have already
been declared,
use a do...while loop to compute the sum of the cubes of the first
n whole numbers, and store this value in total.
Use no variables other than n, k, and total.
SumOfCubes.java:
public class SumOfCubes {
public static void main(String args[]) {
int n=10;//n is value for
which we need sum of cubes upto
int k=1,total=0;//k is used
for iteration and total to store the sum
do
{
total =
total + k*k*k;//calculating cube of number and adding it to
total
k++;
}
while(k<=n);
System.out.println(total);//print value of total
}
}
Output:

SumOfCubes.java:( value of n entered during run-time)
import java.util.*;
public class SumOfCubes {
public static void main(String args[]) {
Scanner in = new
Scanner(System.in);
int n=0;//n is value for which
we need sum of cubes upto
int k=1,total=0;//k is used
for iteration and total to store the sum
System.out.println("Enter
value of n:");//input given during run-time
n = in.nextInt();
do
{
total =
total + k*k*k;//calculating cube of number and adding it to
total
k++;
}
while(k<=n);
System.out.println(total);//print value of total
}
}
Output:

java : Given an int variable n that has been initialized to a positive value and,...
CODE MUST BE IN C 1. Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alreadybeen declared, use a while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total. Use no variables other than n, k, and...
1.Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a for loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total. Use no variables other than n, k, and total.(c++) 2.Given an int variable...
Given an int variable k that has already been declared, use a while loop to print a single line consisting of 97 asterisks. Use no variables other than k. PLEASE ANSWER IN C
assume that input is an int array. the array is already declared and initialized wnd every element is assigned to an integer number. in addition assume that the array contains at least 1 element. write a code that contains one while loop abd no other loops to find both maximum and minimum numbers from input. then outout the maximum minus the minumum to the console window. (using java eclipse coding)
Convert the following while loop into a for loop. int 1 - 50: int sum-07 while (sum < 1000) sum - sum + 1; Question 35 (2 points) Saved Given an int variable k that has already been declared, use a while loop to print a single line consisting of 80 dollar signs. Use no variables other than k. int sum = 0; for(int i = 100;sum < 10000;1-- sum = sum + i;
public static List sumOfDistinctCubes(int n) Determine whether the given positive integer n can be expressed as a sum of cubes of positive integers greater than zero so that all these integers are distinct. For example, the integer n = 1456 can be expressed as sum 11 3 + 5 3 . This method should return the list of these distinct integers as a list [11, 5] with the elements given in descending order. If n cannot be broken into a...
Java An int variable n contains a positive integer and a String variable s contains a String. Write the Java code needed to print "YES" if the first n characters of s appear more than once in s, and print "NO" otherwise.
In C
An array ints of integers has already been declared and initialized. A function printint has been defined with the following prototype: void printint(int *); Write code that will call printint with a pointer to the second value in the array ints. Note: you will not need to declare an int variable.
Given an int variable n that has already been declared, write some code in C that repeatedly reads a value into n until at last a number between 1 and 10 (inclusive) has been entered.
anslate Assume that number is an int variable that has already been initialized. Write a statement that prints out the value of number in a field of 10 positions (right-justified within that field). Hint: Assume #include <iomanip> is included in the program. В І ЦА HTML Editor I 5 7 7 7 7 x x = = 1:12pt Paragraf O words 18 ctv A