Fix the following lines of code Float diff = {2.4 , 9.4, 2.4, 4.8} Write an arra
ID: 3710380 • Letter: F
Question
Fix the following lines of codeFloat diff = {2.4 , 9.4, 2.4, 4.8}
Write an array declaration (size 50) and a supporting class Credit card transactions that contain a transaction number a merchant name and a charge
Write array declaration (size 50) and a supporting class to represent Students names for a class and homework grades for each student
Write a code that prints the values stored in a array called names backwards
Fix the following lines of code
Float diff = {2.4 , 9.4, 2.4, 4.8}
Write an array declaration (size 50) and a supporting class Credit card transactions that contain a transaction number a merchant name and a charge
Write array declaration (size 50) and a supporting class to represent Students names for a class and homework grades for each student
Write a code that prints the values stored in a array called names backwards
Fix the following lines of code
Float diff = {2.4 , 9.4, 2.4, 4.8}
Write an array declaration (size 50) and a supporting class Credit card transactions that contain a transaction number a merchant name and a charge
Write array declaration (size 50) and a supporting class to represent Students names for a class and homework grades for each student
Write a code that prints the values stored in a array called names backwards
Float diff = {2.4 , 9.4, 2.4, 4.8}
Write an array declaration (size 50) and a supporting class Credit card transactions that contain a transaction number a merchant name and a charge
Write array declaration (size 50) and a supporting class to represent Students names for a class and homework grades for each student
Write a code that prints the values stored in a array called names backwards
Explanation / Answer
Question:--- Float diff = {2.4 , 9.4, 2.4, 4.8}
Answer:--- Invalid , a float can not be declared and initialized using an initializer list: " [ ] " is missing.You can placed " [ ] " after the element type ("float") or after the reference variable ("diff").
Question:----- Write an array declaration (size 50) and a supporting class
Credit card transactions that contain a transaction number a merchant name and a charge.
Answer:----
int [ ] Transactions = new int[ 50 ];
public class Transaction
{
private int transactionNumber;
private String merchantName;
private double charge;
}
Question:--- Write array declaration (size 50) and a supporting class to represent
Students names for a class and homework grades for each student .
Answer:----
int [ ] Students = new int [50];
public class Students
{
private String name;
private int [ ] grade;
}
Question:--- Write a code that prints the values stored in a array called names backwards ?
Answer:--- for (int i = names.length - 1; i >= 0; i - - )
System .out.println (names [ i ] );
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.