Question

In: Computer Science

Homework 4 Put all home works together and use methods to simplify code. Also expand to...

Homework 4

Put all home works together and use methods to simplify code. Also expand to have preferences and budget for wall coverings the way that was done for floor options

Use separate Methods to calculate the change for each the Door, Window and Bookcase (Hint – you may want to use 2 methods for the book case effects since one is floor and other is wall).

The user shall input the dimensions of the room and the eventual output will be how the walls and flooring is done and how much budget is left.

The user will input the number of doors, windows, and bookcases and the dimensions of each which will be used to adjust the total wall and floor space needed to be covered. The system will output the square feet of wall and floor after adjustments.

The user will be asked for his budget for the walls and if he has a preference for the type of material for the wall. The system will accept as input the costs for the different wall coverings and determine which wall covering the user can afford – being either his preference or the most expensive if he does not have a preference. It’s also possible the user can not afford any wall coverings. The budget left after the wall covering is kept for how much money is left.

The system will output the initial budget for walls, the selected option and cost and what is left in the budget for walls.

The same process will work for floor coverings with the same output for flooring.

YOU also have COST OPTIONS FOR WALLS, A USER PREFERENCE AND A BUDGET, YOU WILL DO THE SAME FOR THE WALL. SAME RULES APPLY – IF 0 THEN JUST PICK MOST EXPENSIVE, IF PREFERENCE GIVE PREFERENCE IF CAN AFFORD, IF NOT GIVE WHAT CAN AFFORD.

There are four options for wall cover (Ceramic Tile = 1; Paneling = 2, Wallpaper = 3; and paint = 4) each with a cost per square foot The program will ask for input and read in the budget in dollars and cents, the cost per square foot for each of the different wall options and also ask for which one the customer prefers where 0 means the customer does not care and 1-4 if they have a specific preference.

Output the users preference, their budget, if they got their preference, and what they did get. Also how much budget is left.

You will be graded on how well you map this to methods and how good the comments are explaining what the program does.

Use the following for data (it is the same as HW 3 so you should get the same selection answers for flooring as you get there.

·         First renovation project (THREE DOORS, ONE BOOKSHELF, NO WINDOWS)

o    Room is 12 feet long, 12 feet wide, and 12 feet high

o    Door 1 is 2 feet wide by 10 feet high

o    Door 2 is 3 feet wide by 5 feet high

o    Door 3 is 3 feet wide by 5 feet high

o    Bookshelf is 8 feet long by 10 feet high by 2 feet deep

o    No windows

·         Second renovation project (3 WINDOWS, 2 BOOKSHELFS, NO DOORS)

o    Room is 24 feet long, 12 feet wide, and 8 feet high

o    Window 1 is 2 feet wide by 6 feet high

o    Window 2 is 3 feet wide by 5 feet high

o    Window 3 is 8 feet wide by 5 feet high

o    Bookshelf 1 is 8 feet long by 6 feet high by 3 feet deep

o    Bookshelf 2 is 3 feet long by 6 feet high by 2 feet deep

o    No doors

·         Third renovation project (ONE DOOR, 2 WINDOWSS, ONE BOOKSHELF)

o    Room is 12.75 feet long, 11.25 feet wide, and 12 feet high

o    Door is 1.95 feet wide by 10 feet high

o    Window 1 is 2.5 feet wide by 5 feet high

o    Window 2 is 6.8 feet wide by 7.2 feet high

o    Bookshelf is 8 feet long by 6 feet high by 3 feet deep

For Flooring use:

Tile= $4.00 /sq ft; Wood = $3.00/ sq ft; Carpet = $2.00/ sq ft and linoleum = $1.00/sq ft).

Use the following as the budget and preference:

Budget/preference

Renovation 1

Renovation 2

Renovation 3

User preference

0

1

3

Budget

255.00

250.00

400.00

There are four options for wall cover (Ceramic Tile = 1; Paneling = 2, Wallpaper = 3; and paint = 4) each with a cost per square foot

For all three test renovation projects use Tile= $4.00 /sq ft; Paneling = $3.00/ sq ft; Wallpaper = $2.00/ sq ft and paint = $1.00/sq ft).

Use the following as the budget and preference:

Renovation 1

Renovation 2

Renovation 3

User preference

0

4

3

Budget

1200.00

250.00

6000.00

hw 3

package lab;

import static java.lang.System.*;
import java.util.Scanner;
// Renovation Project
public class hw3 {
{
}
public static void main(String args[]) {
double rheight, rwidth, rlength; //room height,width and length variabe
int numberOfDoors,numberOfWindows,numberOfBookCases=0;
double dheight=0, dwidth=0; //door height and width variable
double w1height, w1width;//window1 height and width variable
//double w2height, w2width;//window2 height and width variable
double bheight, bwidth, blength;//bookshelf height ,length and width variable
double paintArea, carpentArea, floorArea;
double paintCost, carpentCost = 0, floorCost, budget;
int preferences = 0;
String flooring = "";
Scanner s = new Scanner(System.in);
out.print("Enter the Room height : ");
rheight = s.nextDouble();
out.print("\nEnter the Room width : ");
rwidth = s.nextDouble();
out.print("\nEnter the Room length : ");
rlength = s.nextDouble();
//Taking number of Rooms as input
out.print("Enter the Number of Doors: ");
numberOfDoors=s.nextInt();
double totalDoorSize=0;
//calculate total size of doors by iterating over number of doors
for(int i=1;i<=numberOfDoors;i++){
out.print("\nEnter the Door"+i+" height : ");
dheight = s.nextDouble();
out.print("\nEnter the Door"+i+" width : ");
dwidth = s.nextDouble();
totalDoorSize=totalDoorSize+(dheight*dwidth);
}
//Taking number of Windows as input
out.print("Enter the Number of Windows: ");
numberOfWindows=s.nextInt();
double totalWindowSize=0;
//calculate total size of doors by iterating over number of windows
for(int i=1;i<=numberOfWindows;i++){
out.print("\nEnter the Window"+i+" height : ");
w1height = s.nextDouble();
out.print("\nEnter the Window"+i+" width : ");
w1width = s.nextDouble();
totalWindowSize=totalWindowSize+(w1height*w1width);
}
//Taking number of Bookcases as input
out.print("Enter the Number of Bookcases: ");
numberOfBookCases=s.nextInt();
double totalBookCasesCarpetArea=0,totalBookCasesPaintArea=0;
//calculate total size of doors by iterating over number of bookcase
for(int i=1;i<=numberOfBookCases;i++){
out.print("\nEnter the bookshelf"+i+" height : ");
bheight = s.nextDouble();
out.print("\nEnter the bookshelf"+i+" width : ");
bwidth = s.nextDouble();
out.print("\nEnter the bookshelf"+i+" length : ");
blength = s.nextDouble();
totalBookCasesCarpetArea=totalBookCasesCarpetArea+(bwidth*blength);
totalBookCasesPaintArea=totalBookCasesPaintArea+(bheight*blength);
}
//Commenting out hard coded values for number of doors,window and bookcases
/*out.print("\nEnter the Window1 height : ");
w1height = s.nextDouble();
out.print("\nEnter the Window1 width : ");
w1width = s.nextDouble();
out.print("\nEnter the Window2 height : ");
w2height = s.nextDouble();
out.print("\nEnter the Window2 width : ");
w2width = s.nextDouble();*/
/* out.print("\nEnter the bookshelf height : ");
bheight = s.nextDouble();
out.print("\nEnter the bookshelf width : ");
bwidth = s.nextDouble();
out.print("\nEnter the bookshelf length : ");
blength = s.nextDouble();*/
out.print("\nEnter the painting cost per square feet: $");
paintCost = s.nextDouble();
// out.print("\nEnter the carpenting cost per square feet: $");
// carpentCost = s.nextDouble();
out.print("\nChoose Flooring type : \n0: No Preferences\n1: Ceramic Tile \n2: Hardwood \n3: Carpet \n4: linoleum tile \n Enter Flooring type : ");
preferences = s.nextInt();
out.print("\nEnter your budget for flooring: ");
budget = s.nextDouble();
paintArea = 2 * rheight * (rwidth + rlength) - (totalBookCasesPaintArea) - (totalWindowSize) - (totalDoorSize); //calculation of paint area
carpentArea = (rwidth * rlength) - (totalBookCasesCarpetArea); //calculation of carpent area
/*paintArea = 2 * rheight * (rwidth + rlength) - (bheight * blength) - (w1width * w1height) - (w2width * w2height) - (dheight * dwidth); //calculation of paint area
carpentArea = (rwidth * rlength) - (bwidth * blength); //calculation of carpent area
*/ switch (preferences) {
case 0:
if (4 * carpentArea <= budget) {
carpentCost = 4;
flooring = "Ceramic Tile";
} else if (3 * carpentArea <= budget) {
carpentCost = 3;
flooring = "Hardwood";
} else if (2 * carpentArea <= budget) {
carpentCost = 2;
flooring = "Carpet";
} else if (1 * carpentArea <= budget) {
carpentCost = 1;
flooring = "Lenolieum Tile";
} else {
carpentCost = 0;
flooring = "";
}
break;
case 1:
if (4 * carpentArea <= budget) {
carpentCost = 4;
flooring = "Ceramic Tile";
} else {
carpentCost = 0;
}
break;
case 2:
if (3 * carpentArea <= budget) {
carpentCost = 3;
flooring = "Hardwood";
} else {
carpentCost = 0;
}
break;
case 3:
if (2 * carpentArea <= budget) {
carpentCost = 2;
flooring = "Carpet";
} else {
carpentCost = 0;
}
break;
case 4:
if (1 * carpentArea <= budget) {
carpentCost = 1;
flooring = "Lenolieum Tile";
} else {
carpentCost = 0;
}
break;
}
out.println("Area of wall after removing the paining area : " + paintArea);
out.println("Area of floor after removing area of bookshelf : " + carpentArea);
out.println("Cost for painting : $" + (paintArea * paintCost));
if (carpentCost != 0) {
out.println("flooring type : " + flooring);
out.println("Cost for flooring : $" + (carpentArea * carpentCost));
} else {
out.println("No Affordable flooring available in given budget");
}
}
}
/*
Renovation1
Enter the Room height : 12

Enter the Room width : 12

Enter the Room length : 12
Enter the Number of Doors: 3

Enter the Door1 height : 10

Enter the Door1 width : 2

Enter the Door2 height : 5

Enter the Door2 width : 3

Enter the Door3 height : 5

Enter the Door3 width : 3
Enter the Number of Windows: 0
Enter the Number of Bookcases: 1

Enter the bookshelf1 height : 10

Enter the bookshelf1 width : 2

Enter the bookshelf1 length : 8

Enter the painting cost per square feet: $1

Choose Flooring type :
0: No Preferences
1: Ceramic Tile
2: Hardwood
3: Carpet
4: linoleum tile
Enter Flooring type : 0

Enter your budget for flooring: 255.00
Area of wall after removing the paining area : 446.0
Area of floor after removing area of bookshelf : 128.0
Cost for painting : $446.0
flooring type : Lenolieum Tile
Cost for flooring : $128.0

Renovation 2
Enter the Room height : 8

Enter the Room width : 12

Enter the Room length : 24
Enter the Number of Doors:
0
Enter the Number of Windows: 3

Enter the Window1 height : 6

Enter the Window1 width : 2

Enter the Window2 height : 5

Enter the Window2 width : 3

Enter the Window3 height : 5

Enter the Window3 width : 8
Enter the Number of Bookcases: 2

Enter the bookshelf1 height : 6

Enter the bookshelf1 width : 3

Enter the bookshelf1 length : 8

Enter the bookshelf2 height : 6

Enter the bookshelf2 width : 2

Enter the bookshelf2 length : 3

Enter the painting cost per square feet: $1.57

Choose Flooring type :
0: No Preferences
1: Ceramic Tile
2: Hardwood
3: Carpet
4: linoleum tile
Enter Flooring type : 1

Enter your budget for flooring: 250.00
Area of wall after removing the paining area : 443.0
Area of floor after removing area of bookshelf : 258.0
Cost for painting : $695.51
No Affordable flooring available in given budget


Renovation 3
Enter the Room height : 12

Enter the Room width : 11.25

Enter the Room length : 12.75
Enter the Number of Doors: 1

Enter the Door1 height : 10

Enter the Door1 width : 1.95
Enter the Number of Windows: 2

Enter the Window1 height : 5

Enter the Window1 width : 2.5

Enter the Window2 height : 7.2

Enter the Window2 width : 6.8
Enter the Number of Bookcases: 1

Enter the bookshelf1 height : 6

Enter the bookshelf1 width : 3

Enter the bookshelf1 length : 8

Enter the painting cost per square feet: $0.95

Choose Flooring type :
0: No Preferences
1: Ceramic Tile
2: Hardwood
3: Carpet
4: linoleum tile
Enter Flooring type : 3

Enter your budget for flooring: 400.00
Area of wall after removing the paining area : 447.04
Area of floor after removing area of bookshelf : 119.4375
Cost for painting : $424.688
flooring type : Carpet
Cost for flooring : $238.875


*/

Please write the code with comments for everything thank you! and don't use objects

Solutions

Expert Solution

package lab;

import static java.lang.System.*;
import java.util.Scanner;
// Renovation Project
public class hw3 {
{
}
    public static double totalDoorSizes()           //calculate the total area taken by doors
    {
        Scanner s = new Scanner(System.in);
        int numberOfDoors;
        out.print("Enter the Number of Doors: ");
        numberOfDoors=s.nextInt();
        double dheight,dwidth,totalDoorSize=0;
        for(int i=1;i<=numberOfDoors;i++)
        {
            out.print("\nEnter the Door"+i+" height : ");
            dheight = s.nextDouble();
            out.print("\nEnter the Door"+i+" width : ");
            dwidth = s.nextDouble();
            totalDoorSize=totalDoorSize+(dheight*dwidth);
        }
        return totalDoorSize;
    }
    public static double totalWindowSizes()         //calculate the total area taken by windows
    {
        double w1height, w1width,totalWindowSize=0;//window1 height and width variable
        Scanner s = new Scanner(System.in);
        int numberOfWindows;
        //Taking number of Windows as input
        out.print("Enter the Number of Windows: ");
        numberOfWindows=s.nextInt();
        //calculate total size of doors by iterating over number of windows
        for(int i=1;i<=numberOfWindows;i++)
        {
            out.print("\nEnter the Window"+i+" height : ");
            w1height = s.nextDouble();
            out.print("\nEnter the Window"+i+" width : ");
            w1width = s.nextDouble();
            totalWindowSize=totalWindowSize+(w1height*w1width);
        }
        return totalWindowSize;
    }
    public static double bookShelfCarpetArea(double a, double b,double c)       //calculate carpet area for book shelf
    {
        return a+b*c;
    }
    public static double bookShelfPaintArea(double a, double b,double c)        //calculate paint area for book shelf
    {
        return a+b*c;
    }
    public static void main(String args[])
    {
        double rheight, rwidth, rlength; //room height,width and length variabe
        int numberOfBookCases;
        double bheight, bwidth, blength;//bookshelf height ,length and width variable
        double paintArea, carpentArea;
        double paintCost=0, carpentCost = 0, budget;
        int preferences ;
        String flooring = "";
        String wallCover="";
        Scanner s = new Scanner(System.in);
        out.print("Enter the Room height : ");      //taking input room details, here height
        rheight = s.nextDouble();
        out.print("\nEnter the Room width : ");     //taking input room width
        rwidth = s.nextDouble();
        out.print("\nEnter the Room length : ");    //taking input room length
        rlength = s.nextDouble();
      
        double totalDoorSize = totalDoorSizes();        //calculating total area by door
        double totalWindowSize = totalWindowSizes();        //calculating total area by window
      
        out.print("Enter the Number of Bookcases: ");       //entering number of bookcases
        numberOfBookCases=s.nextInt();
        double totalBookCasesCarpetArea=0,totalBookCasesPaintArea=0;
        //calculate total size of doors by iterating over number of bookcase
        for(int i=1;i<=numberOfBookCases;i++)
        {
            out.print("\nEnter the bookshelf"+i+" height : ");
            bheight = s.nextDouble();
            out.print("\nEnter the bookshelf"+i+" width : ");
            bwidth = s.nextDouble();
            out.print("\nEnter the bookshelf"+i+" length : ");
            blength = s.nextDouble();
            totalBookCasesCarpetArea=bookShelfCarpetArea(totalBookCasesCarpetArea,bwidth,blength); //calling function to calculate book shelf floor area
            totalBookCasesPaintArea=bookShelfPaintArea(totalBookCasesPaintArea,bheight,blength);    //calling function to calculate book shelf wall area
        }
        // out.print("\nEnter the carpenting cost per square feet: $");
        // carpentCost = s.nextDouble();
        out.print("\nChoose Flooring type : \n0: No Preferences\n1: Ceramic Tile \n2: Hardwood \n3: Carpet \n4: linoleum tile \n Enter Flooring type : ");
        preferences = s.nextInt();      //prefernce for flooring type
        out.print("\nEnter your budget for flooring: ");
        budget = s.nextDouble();        //budget for flooring type
        paintArea = 2 * rheight * (rwidth + rlength) - (totalBookCasesPaintArea) - (totalWindowSize) - (totalDoorSize); //calculation of paint area
        carpentArea = (rwidth * rlength) - (totalBookCasesCarpetArea); //calculation of carpent area
      
        switch (preferences)        //switch on the basis of flooring type preferences
        {
        case 0:     //for case where user does not have a preference, calculating what is affordable by user
                if (4 * carpentArea <= budget)    
                {
                    carpentCost = 4;
                    flooring = "Ceramic Tile";
                }
                else if (3 * carpentArea <= budget)
                {
                    carpentCost = 3;
                    flooring = "Hardwood";
                }
                else if (2 * carpentArea <= budget)
                {
                    carpentCost = 2;
                    flooring = "Carpet";
                }
                else if (1 * carpentArea <= budget)
                {
                    carpentCost = 1;
                    flooring = "Lenolieum Tile";
                }
                else
                {
                    carpentCost = 0;
                    flooring = "";
                }
                break;
        case 1:         //if preference is creamic tile
                if (4 * carpentArea <= budget)
                {
                    carpentCost = 4;
                    flooring = "Ceramic Tile";
                }
                else
                {
                    carpentCost = 0;
                }
                break;
        case 2:         //if flooring preference is hardwood
            if (3 * carpentArea <= budget)
            {
                carpentCost = 3;
                flooring = "Hardwood";
            }
            else
            {
                carpentCost = 0;
            }
            break;
        case 3:         //if flooring preference is carpet
            if (2 * carpentArea <= budget)
            {
                carpentCost = 2;
                flooring = "Carpet";
            }
            else
            {
                carpentCost = 0;
            }
            break;
        case 4:         //if flooring preference is Lenolieum Tile
            if (1 * carpentArea <= budget)
            {
                carpentCost = 1;
                flooring = "Lenolieum Tile";
            }
            else
            {
                carpentCost = 0;
            }
            break;
        }
        out.println("Area of floor after removing area of bookshelf : " + carpentArea);//print floor area
        if (carpentCost != 0)       //if budget is sufficient
        {
            out.println("flooring type : " + flooring);     //floorimg type either user choice or assigned
            out.println("Cost for flooring : $" + (carpentArea * carpentCost));     //flooring cost
        }
        else
        {
            out.println("No Affordable flooring available in given budget");        //if not affordable
        }
      
      
        out.print("\nChoose Wall Cover type : \n0: No Preferences\n1: Ceramic Tile \n2: Paneling \n3: Wallpaper \n4: Paint \n Enter Wall cover type : ");
        preferences = s.nextInt();      //taking in wall cover preference
        out.print("\nEnter your budget for covering wall: ");
        budget = s.nextDouble();        //budget for wall covering
      
        switch (preferences)    //switching on basis of wall cover preference
        {
        case 0:         //if user didnt chose anything
                if (4 * paintArea <= budget)
                {
                    paintCost = 4;
                    wallCover = "Ceramic Tile";
                }
                else if (3 * paintArea <= budget)
                {
                    paintCost = 3;
                    wallCover = "Paneling";
                }
                else if (2 * paintArea <= budget)
                {
                    paintCost = 2;
                    wallCover = "Carpet";
                }
                else if (1 * paintArea <= budget)
                {
                    paintCost = 1;
                    wallCover = "Lenolieum Tile";
                }
                else
                {
                    paintCost = 0;
                    wallCover = "";
                }
                break;
        case 1:             //if wall cover preference is creamic tile
                if (4 * paintArea <= budget)
                {
                    paintCost = 4;
                    wallCover = "Ceramic Tile";
                }
                else
                {
                    paintCost = 0;
                }
                break;
        case 2:         //if wall cover preference is paneling
            if (3 * paintArea <= budget)
            {
                paintCost = 3;
                wallCover = "Paneling";
            }
            else
            {
                paintCost = 0;
            }
            break;
        case 3:             //if wall cover preference is wallpaper
            if (2 * paintArea <= budget)
            {
                paintCost = 2;
                wallCover = "Wallpaper";
            }
            else
            {
                paintCost = 0;
            }
            break;
        case 4:         //if wall cover preference is paint
            if (1 * paintArea <= budget)
            {
                paintCost = 1;
                wallCover = "Paint";
            }
            else
            {
                paintCost = 0;
            }
            break;
        }
        out.println("Area of wall after removing the paining area : " + paintArea); //paint area
        if (paintCost != 0)
        {
            out.println("Wall cover type : " + wallCover);        //type of wall cover assigned or chosen
            out.println("Cost for Wall covering : $" + (carpentArea * carpentCost));    //cost of wall covering
        }
        else
        {
            out.println("No Affordable Wall cover available in given budget");      //out of budget selection
        }
    }
}

Ask any questions if you have in comment section below.

Please rate the answer


Related Solutions

Plot all four curves over 0 < t < 4 together using MATLAB. Post code in...
Plot all four curves over 0 < t < 4 together using MATLAB. Post code in the response. C1 : x=−5+2e−tcos20t y=−5+2e−tsin20t z=4t C2 : x=−5+2e−tcos20t y=5+2e−tsin20t z=4t C3 : x=5+2e−tcos20t y=−5+2e−tsin20t z=4t C4 : x=5+2e−tcos20t y=5+2e−tsin20t z=4t
Homework 4: Probability and z scores Use the data to answer the following questions Show all...
Homework 4: Probability and z scores Use the data to answer the following questions Show all work (*round 2 decimals places) What is the mean & SD for the distribution of scores? What is the corresponding z score for each raw score? What is the probability of getting a raw score greater than 4? What is the probability of getting a raw score less than 2? What is the probability of a raw score between 4 & 6? What is...
Summarize what PKI is and how it works. Include the use of a CA and also...
Summarize what PKI is and how it works. Include the use of a CA and also include why the backing up of these keys is so important. Assignment Objectives: Summarize the role of Public Key Infrastructure (PKI). Discuss the use of a Certificate Authority (CA). 500 words or more, please.
Take all the methods from this program and put it into single program and compile, and...
Take all the methods from this program and put it into single program and compile, and then test the program with some expressions. Should have two files: Lex.java and a output.txt file package lexicalanalyser; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.logging.Level; import java.util.logging.Logger; enum CharacterClass{ LETTER(0), DIGIT(1), UNKNOWN(99), EOF(-1); private int value; private CharacterClass(int value){ this.value = value; } public int getValue(){ return value; } } enum TokenCodes{ INT_LIT(10), IDENT(11), ASSIGN_OP(20), ADD_OP(21), SUB_OP(22),...
code in python I want to make a function that adds all the multipliers together. The...
code in python I want to make a function that adds all the multipliers together. The code is posted below and please look at wanted output section to see what I want the code to output. The last line of the code is the only addition I need. Thanks. Code: initial=int(input("Initial value : "))       #taking inputs multiplier=float(input("Multiplier : ")) compound=int(input("No of compounds : ")) print("Your values are:") mult=initial                         #initalizing to find answer for i in range(0,compound):         #multiplying by multiplier    ...
Also please add comments on the code and complete in C and also please use your...
Also please add comments on the code and complete in C and also please use your last name as key. The primary objective of this project is to increase your understanding of the fundamental implementation of Vigenere Cipher based program to encrypt any given message based on the Vignere algorithm. Your last name must be used as the cipher key. You also have to skip the space between the words, while replicating the key to cover the entire message. Test...
Let’s put it all together in an example: Hermione Corp. has 400,000 shares of common stock...
Let’s put it all together in an example: Hermione Corp. has 400,000 shares of common stock outstanding, trading at $52.85 per share. They have 90,000 shares of preferred stock trading at $74.14 per share, and $15,000,000 (face value) in debt, with 8 years to maturity, a 9% coupon, and a YTM of 8%. The firm has a beta of 1.97, the risk-free rate is 2.5% and the expected market return is 12%. Their last preferred dividend was $9.25 per share....
please I don't understand this code. Can you put comments to explain the statements. Also, if...
please I don't understand this code. Can you put comments to explain the statements. Also, if there any way to rewrite this code to make it easier, that gonna help me a lot. import java.io.*; import java.util.*; public class State {    private int citi1x,citi1y; private int pop1; private int citi2x,citi2y; private int pop2; private int citi3x,citi3y; private int pop3; private int citi4x,citi4y; private int pop4; private int plantx,planty; public int getCity1X(){ return citi1x; } public int getCity1Y(){ return citi1y;...
IN JAVA. I have the following code (please also implement the Tester to test the methods...
IN JAVA. I have the following code (please also implement the Tester to test the methods ) And I need to add a method called public int remove() that should remove the first integer of the array and return it at the dame time saving the first integer and bring down all other elements. After it should decrease the size of the array, and after return and save the integer. package ourVector; import java.util.Scanner; public class ourVector { private int[]...
Question 7 Use the following income statement and balance sheet information to put together a statement...
Question 7 Use the following income statement and balance sheet information to put together a statement of cash flows. (Enter negative amounts using either a negative sign preceding the number e.g. -45 or parentheses e.g. (45).) 2017 Sales $1,242,000 Cost of goods sold $685,000 Gross profit $557,000 Gen'l & admin expense $156,000 Selling & mkt expense $135,000 Depreciation $24,000 Operating income $242,000 Interest $140,000 Income before taxes $102,000 Income taxes (27%) $27,540 Net income $74,460 Dividends paid $25,000 Assets 2017...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT