GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Look at the following code: // [All the necessary imports he…

Look at the following code: // [All the necessary imports here, omitted]public class FinalExamApp extends Application {    private ArrayList winterPlans = new ArrayList();    public void start(Stage stage) {        stage.setTitle(“Final Exam App”); Label label = new Label(“Winter Idea: “); TextField textfield = new TextField(); Button button1 = new Button(“Add Idea”); Button button2 = new Button(“Sort Plan”); // Code for buttons will be here VBox root = new VBox(); root.getChildren().add(label); root.getChildren().add(textfield); root.getChildren().add(button1);        root.getChildren().add(button2); Scene scene = new Scene(root); stage.setScene(scene); stage.show(); }} Using an anonymous inner class, implement the functionality of button1 such that it adds the value in textfield to winterPlans when pressed and then clears the text field. You should only add it to the list if the text is not empty.

Read Details

Implement public static int calculateNumberSum(int[] arr), a…

Implement public static int calculateNumberSum(int[] arr), a method that calculates and returns the sum of all the numbers in the array. It should use the helper method you created in the previous question.

Read Details

Identify the bone marking (opening) labelled ‘8’

Identify the bone marking (opening) labelled ‘8’

Read Details

Identify this bat-shaped bone from the skull

Identify this bat-shaped bone from the skull

Read Details

A velocity analysis can be used on single-cell RNA sequencin…

A velocity analysis can be used on single-cell RNA sequencing data to understand how or whether a given cell or cluster of cells was transcriptionally differentiating at the time of sample collection. What sort of data does a velocity analysis use to determine this?

Read Details

Continue to work on your essay in this space

Continue to work on your essay in this space

Read Details

CRISPR-based lineage tracing works by making a transgenic or…

CRISPR-based lineage tracing works by making a transgenic organism containing which of the following? Select all correct responses.

Read Details

Use the supplied solution, search for TODO then write the co…

Use the supplied solution, search for TODO then write the code and test the application. Remember to Download the FinalExam.zip and unzip. Open VehicleRepair.sln in Visual Studio 2022. Right-click on the RepairUI project and ensure it is ‘Set as StartUp Project’. Answer as many questions as possible, partial credit will be granted. Run the application to perform testing as needed. If you receive this error, “Couldn’t process file due to its being in the Internet or Restricted zone or having the mark of the web on the file. Remove the mark of the web if you want to process these files.” You can use file explorer to update the properties for the frmMain.resx and frmDetails.resx files to Unblock the Security attribute. SUBMISSION: Please copy/paste the COMPLETED code below from the frmMain.cs and frmDetails.cs files into the answer to this question, which should include the missing TODO code to complete the program. You are developing an application that allows users to capture details for vehicle repair program.  The user must select a repair type.  Next click details to enter the repair details, click OK will display repair details and click Close will close form.  Finally click the cost button to display repair cost.  Given the solution, which is a 3-tier application and uses class inheritance with a RepairBO base class, follow comments and write code to meet requirements: The user must select vehicle type for Details button click to open Details screen. When the user clicks Details, open the Details screen as modal. Should be able to change repair details until clicking OK and Close on Details screen. When the user enters details and clicks OK: Validate numeric values and display any errors using a message box. Populate values from screen into the business object. Display values from business object on the Main screen. When the user clicks Cost, use business object to determine and display the repair cost. ‘Affirmation of Authorship: ‘Name: ‘Date: ‘I affirm that this program was created by me. It is solely my work and does not include anyone else work.   public partial class frmMain : Form{    // TODO #1: Public class variable objRepair for RepairBO (1 point)     // TODO #2: Create class variable for Details form (1 point)     public frmMain()    {        InitializeComponent();    }     // Check to determine cost for repairs    private void btnCost_Click(object sender, EventArgs e)    {        try        {            // Define and initialize dblCost variable            double dblCost = 0.00;             // TODO #3: Populate dblCost by calling objRepair Cost() function (1 point)             // Display message based on cost            if (dblCost > 0)            {                // TODO #4: Populate lblResult to indicate repair cost (1 point)             }            else            {                // TODO #5: Populate lblResult to indicate details needed (1 point)             }        }         catch (Exception ex)        {             // TODO #6: Populate lblResult with error message (1 point)          }    }    private void MainForm_Load(object sender, EventArgs e)    {        // TODO #7: Clear lblDetails and lblResults (1 point)         // TODO #8: Add the vehicle types to the combobox using Types() from the RepairBO business object (1 point)      }     private void btnDetails_Click(object sender, EventArgs e)    {        // Edit to ensure a repair type is selected        if (!string.IsNullOrEmpty(cboRepairType.Text))        {             // TODO #9: Clear lblResults (1 point)             // TODO #10: Show the details form as dialog (1 point)           }         else        {             // Display message for user to select a repair type            MessageBox.Show(“Please select a repair type.”);        }     } }   public partial class frmDetails : Form{    private frmMain objFrmMain;     // Dimension private class variable for repair type    private string strRepairType;     // TODO #11: Dimension public class variables for EngineRepairBO (1 point)     // TODO #12: Dimension public class variables for BodyRepairBO (1 point)     public frmDetails(frmMain objFrm)    {        objFrmMain = objFrm;        InitializeComponent();    }     private void btnOK_Click(object sender, EventArgs e)    {         try        {            // TODO #13: Call PopulateValues() method (1 point)             // Based on the specific repair type selected on MainForm,            // Populate MainForm public objRepair from DetailForm either objEngine or objBody            // and MainForm lblDetails from DetailForm objEngine or objBody .ToString()            switch (strRepairType ?? “”)            {                case “Body”:                    {                        // TODO #14: Populate MainForm public objRepair from DetailForm objBody (1 point)                         // TODO #15: Populate MainForm lblDetails from DetailForm objBody .ToString() (1 point)                         break;                    }                case “Engine”:                    {                        // TODO #16: Populate MainForm public objRepair from DetailForm objEngine (1 point)                         // TODO #17: Populate MainForm lblDetails from DetailForm objEngine .ToString() (1 point)                         break;                    }            }        }         catch (RepairException vx)        {             // Display message and exception number if RepairException occurs            MessageBox.Show(vx.Message + ” – Code=” + vx.ExceptionNumber.ToString());        }         catch (Exception ex)        {             // Display message if Exception occurs            MessageBox.Show(“Please check all input fields. ” + ex.Message);         }    }     private void btnCancel_Click(object sender, EventArgs e)    {        // TODO #18: Hide the details form (1 point)     }     private void PopulateValues()    {         // Based on the specific vehicle type selected on MainForm,        // populate properties in BodyRepairBO or EngineRepairBO        switch (strRepairType ?? “”)        {            case “Body”:                {                    // Populate objBody properties from DetailsForm screen values                     // TODO #19: objBody.ID  (1 point)                     // TODO #20: objBody.Make (1 point)                     // TODO #21: objBody.Model (1 point)                     // TODO #22: objBody.Color (1 point)                     // TODO #23: objBody.NumDoors (1 point)                     // TODO #24: objBody.Sunroof (1 point)                     break;                }            case “Engine”:                {                    // Populate objEngine properties from DetailsForm screen values                     // TODO #25: objEngine.ID (1 point)                     // TODO #26: objEngine.Make (1 point)                     // TODO #27: objEngine.Model (1 point)                     // TODO #20: objEngine.Color (1 point)                     // TODO #29: objEngine.NumCylinders (1 point)                     // TODO #30: objEngine.Hybrid (1 point)                     break;                }        }    }     private void frmDetails_Load(object sender, EventArgs e)    {        // Set class variable for strVehicleType from MainForm cboRepairType        strRepairType = objFrmMain.cboRepairType.Text;         // Based on the specific vehicle type selected on MainForm,        // show appropriate groupbox and hide all other grouboxes        switch (strRepairType ?? “”)        {            case “Engine”:                {                    gbEngineRepair.Show();                    gbBodyRepair.Hide();                    break;                }            case “Body”:                {                    gbEngineRepair.Hide();                    gbBodyRepair.Show();                    break;                }        }    }}

Read Details

When possible, investors and analysts prefer to use book val…

When possible, investors and analysts prefer to use book value to market value for estimating the WACC.

Read Details

If the returns for two assets have a correlation coefficient…

If the returns for two assets have a correlation coefficient of one, then there are no benefits of diversification by combining these assets in a two-asset portfolio.

Read Details

Posts pagination

Newer posts 1 … 35 36 37 38 39 … 71,457 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top