Welcome to AssignmentCache!

Search results for 'Access College Pet Sitters'

Items 21 to 30 of 168 total

per page
Page:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Grid  List 

Set Ascending Direction
  1. PRG421 Week 3 Individual Coding Assignment

    PRG 421 Week 3 Individual Coding Assignment

    Regular Price: $10.00

    Special Price $7.00

    PRG 421 Week 3 Individual Coding Assignment

    For this assignment, you will develop "starter" code. After you finish, your code should access an existing text file that you have created, create an input stream, read the contents of the text file, sort and store the contents of the text file into an ArrayList, then write the sorted contents via an output stream to a separate output text file.
    Copy and paste the following Java™ code into a JAVA source file in NetBeans:
     
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
     
    public class Datasort {
     
    public static void main (String [] args)  {
     
    File fin =      // input  file
    File fout =    // create an out file
     
    // Java FileInputStream class obtains input bytes from a file
    FileInputStream fis = new FileInputStream(fin);    
     
    // buffering characters so as to provide for the efficient reading of characters, arrays, and lines
    BufferedReader in = new BufferedReader(new InputStreamReader(fis));
     
    // declare an array in-line, ready for the sort
    String aLine;
    ArrayList al = new ArrayList ();
     
    int i = 0;
    while ((aLine = in.readLine()) != null) {
    // set the sort  for values is greater than 0
     
    Collections.sort(al);    // sorted content to the output  file
    {
    System.out.println(s);
                  
    }
     // close the 2 files
                          
    }
    }
     
    Add code as indicated in the comments.
    Note: Refer to this week's Individual assignment, "Week Three Analyze Assignment," and to Ch. 8, "IO," in OCP: Oracle® Certified Professional Java® SE 8 Programmer II Study Guide.
    Run and debug your modified program in NetBeans until it satisfies the requirements described above.
    Save your finalized JAVA file with a .txt extension.
    Submit your TXT file to the Assignment Files tab.

    Learn More
  2. PRG 421 Week 1 Individual Analyze Assignment Analyzing a Java Program Containing Abstract and Derived Classes

    PRG 421 Week 1 Individual Analyze Assignment Analyzing a Java Program Containing Abstract and Derived Classes

    Regular Price: $6.00

    Special Price $4.00

    PRG 421 Week 1 Individual Analyze Assignment Analyzing a Java Program Containing Abstract and Derived Classes

    "Analyzing a Java™ Program Containing Abstract and Derived Classes"
    The purpose of creating an abstract class is to model an abstract situation.
    Example:
    You work for a company that has different types of customers: domestic, international, business partners, individuals, and so on. It well may be useful for you to "abstract out" all the information that is common to all of your customers, such as name, customer number, order history, etc., but also keep track of the information that is specific to different classes of customer. For example, you may want to keep track of additional information for international customers so that you can handle exchange rates and customs-related activities, or you may want to keep track of additional tax-, company-, and department-related information for business customers.
    Modeling all these customers as one abstract class ("Customer") from which many specialized customer classes derive or inherit ("International Customer," "Business Customer," etc.) will allow you to define all of that information your customers have in common and put it in the "Customer" class, and when you derive your specialized customer classes from the abstract Customer class you will be able to reuse all of those abstract data/methods.This approach reduces the coding you have to do which, in turn, reduces the probability of errors you will make. It also allows you, as a programmer, to reduce the cost of producing and maintaining the program.
    In this assignment, you will analyze Java™ code that declares one abstract class and derives three concrete classes from that one abstract class. You will read through the code and predict the output of the program.
    Read through the linked Java™ code carefully.
    Predict the result of running the Java™ code. Write your prediction into a Microsoft® Word document, focusing specifically on what text you think will appear on the console after running the Java™ code.
    In the same Word document, answer the following question:
    Why would a programmer choose to define a method in an abstract class, such as the Animal constructor method or the getName() method in the linked code example, as opposed to defining a method as abstract, such as the makeSound() method in the linked example?

    Supporting Material: Week One Analyze Assignment Text File
    /**********************************************************************
    * Program: PRG/421 Week 1 Analyze Assignment
    * Purpose: Analyze the coding for an abstract class
    * and two derived classes, including overriding methods
    * Programmer: Iam A. Student
    * Class: PRG/421r13, Java Programming II
    * Instructor:
    * Creation Date: December 13, 2017
    *
    * Comments:
    * Notice that in the abstract Animal class shown here, one method is
    * concrete (the one that returns an animal's name) because all animals can
    * be presumed to have a name. But one method, makeSound(), is declared as
    * abstract, because each concrete animal must define/override the makeSound() method
    * for itself--there is no generic sound that all animals make.
    **********************************************************************/

    package mytest;

    // Animal is an abstract class because "animal" is conceptual
    // for our purposes. We can't declare an instance of the Animal class,
    // but we will be able to declare an instance of any concrete class
    // that derives from the Animal class.
    abstract class Animal {
    // All animals have a name, so store that info here in the superclass.
    // And make it private so that other programmers have to use the
    // getter method to access the name of an animal.

    private final String animalName;
    // One-argument constructor requires a name.
    public Animal(String aName) {
    animalName = aName;
    }

    // Return the name of the animal when requested to do so via this
    // getter method, getName().
    public String getName() {
    return animalName;
    }

    // Declare the makeSound() method abstract, as we have no way of knowing
    // what sound a generic animal would make (in other words, this
    // method MUST be defined differently for each type of animal,
    // so we will not define it here--we will just declare a placeholder
    // method in the animal superclass so that every class that derives from
    // this superclass will need to provide an override method
    // for makeSound()).
    public abstract String makeSound();
    };

    // Create a concrete subclass named "Dog" that inherits from Animal.
    // Because Dog is a concrete class, we can instantiate it.
    class Dog extends Animal {
    // This constructor passes the name of the dog to
    // the Animal superclass to deal with.
    public Dog(String nameOfDog) {
    super(nameOfDog);
    }

    // This method is Dog-specific.
    @Override
    public String makeSound() {
    return ("Woof");
    }
    }

    // Create a concrete subclass named "Cat" that inherits from Animal.
    // Because Cat is a concrete class, we can instantiate it.
    class Cat extends Animal {
    // This constructor passes the name of the cat on to the Animal
    // superclass to deal with.
    public Cat(String nameOfCat) {
    super(nameOfCat);
    }

    // This method is Cat-specific.
    @Override
    public String makeSound() {
    return ("Meow");
    }
    }

    class Bird extends Animal {
    // This constructor passes the name of the bird on to the Animal
    // superclass to deal with.
    public Bird (String nameOfBird) {
    super(nameOfBird);
    }

    // This method is Bird-specific.
    @Override
    public String makeSound() {
    return ("Squawk");
    }
    }

    public class MyTest {
    public static void main(String[] args) {
    // Create an instance of the Dog class, passing it the name "Spot."
    // The variable aDog that we create is of type Animal.
    Animal aDog = new Dog("Spot");
    // Create an instance of the Cat class, passing it the name "Fluffy."
    // The variable aCat that we create is of type Animal.
    Animal aCat = new Cat("Fluffy");
    // Create an instance of (instantiate) the Bird class.
    Animal aBird = new Bird("Tweety");
    //Exercise two different methods of the aDog instance:
    // 1) getName() (which was defined in the abstract Animal class)
    // 2) makeSound() (which was defined in the concrete Dog class)
    System.out.println("The dog named " + aDog.getName() + " will make this sound: " + aDog.makeSound());
    //Exercise two different methods of the aCat instance:
    // 1) getName() (which was defined in the abstract Animal class)
    // 2) makeSound() (which was defined in the concrete Cat class)
    System.out.println("The cat named " + aCat.getName() + " will make this sound: " + aCat.makeSound());
    System.out.println("The bird named " + aBird.getName() + " will make this sound: " + aBird.makeSound());
    }
    }

    Learn More
  3. Tutorial 14 Case 1 New Accents Photography Romantic Style

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 1 New Accents Photography

    Regular Price: $15.00

    Special Price $12.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 1 New Accents Photography

    After you have completed all of the tutorials in Chapter 14, turn to page 1001 in your textbook and do Case Problem 1, New Accents Photography. Make sure all files are uploaded to cPanel and submit your URL for the accents.htm file when you are finished.

    Use JavaScript to create a dynamic style sheet switcher.

    Data files needed for this Case Problem: accentstxt.htm, base.css, elegant.css, elegant.png, elegant_back.png, elegant_small.png, innovative.css, innovative.png, innovative_back.png, innovative_small.png, joyous.css, joyous.png, joyous_back.png, joyous_small.png, modernizr-1.5.js, nalogo.png, romantic.css, romantic.png, romantic_back.png, romantic_small.png, styletxt.js, zany.css, zany.png, zany_back.png, zany_small.png

    New Accents Photography Christine Drake is the owner and chief photographer at New Accents Photography, a photography studio in Ashland, Oregon, that specializes in wedding photos. Wedding portraiture is a competitive business. and Christine wants to improve the design of her Web site's opening page to help interest couples in viewing her work. Christine is proud of the many and varied styles of portraiture that New Accents Photography offers, and she would like to create an interactive style sheet switcher that loads different style designs based on her photos.
    Christine envisions making several style sheets, and she wants to limit the amount of work she'll have to do when updating the HTML code as she adds new sheets to her site. She would like your help with writing a JavaScript app that examines the list of style sheets in the site's home page and creates a figure box of clickable thumbnail images for each sheet design. A preview of the page you'll create for Christine is shown In figure 14-66.

    Christine already has written the style sheet code and most of the HTML code. Your job will be to write the JavaScript code to enable her customers to switch from one style  design to another.

    Complete the following:
    1. Using your text editor, open accentstxt.htm and styletxt.js from the tutorial.14\case1 folder. Enter your name and the date in the comment section of each file, and then save the files asaccents.htm and stylebox.js, respectively.

    2. Go to the accents.htm file in your text editor. Currently, Christine has only one persistent style sheet linked to her document. Create a link to the preferred style sheet romantic.css and give it the title romantic.

    3. Create links to the following alternate style sheets: elegant.css, joyous.css, innovative.css, and zany.css. Give the style sheets the titles elegant, joyous, innovative, and zany, respectively. Do not disable any of these style sheets at this time. 

    4. Create a link to the styleBox.js file. Take some time to study the rest of the HTML code and then close the file, saving your changes.

    5. Go to the styleBox.js file in your text editor. Below the comments, declare a global variable named allSheets and set it equal to an empty array. The purpose of the allSheets variable will be to store references to each preferred and alternate style sheet in the document.

    6. Add a command to run the loadStyles() function when the page is initially loaded.

    7. Create the loadStyles() function. The purpose of this function is to load all of the preferred and alternate style sheets into the allSheets variable. Add the following commands to the function:
     a. Declare the links variable referencing all link elements in the document.
     b. Loop through the contents of the links object collection. For each item, determine whether it represents a preferred or alternate style sheet with a defined title.
     c. Disable each alternate style sheet, but leave the preferred style sheet enabled.
     d. Use the  push() array method to add each preferred or alternate style sheet to the allSheets array.
     e. After the completion of the for loop, call the displayThumbs() function.
     
    8. Create the displayThumbs() function. The purpose of this function is to display thumbnail images of each style sheet design from the allSheets array. Add the following commands to the function:
     a. Create an element node for the figure element and store it in the figBox variable.
     b. Set the id of the figBox element node to the text string thumbnails.
     c. Loop through each item in the allSheets array, and do the following for each item:
      i)  create an element node for the img element and store it in the sheetImg variable;
      ii) set the source of the sheetImginline image to the file title_small.png, where title is the title value of the current style sheet in the loop; iii)set the title attribute of the inline image to match the title attribute of the current style sheet;
      iv) add an onclick event handler to the inline image to run the showSheet() function when clicked; and
      v)  append sheetImg to the figBox node.
     d. After the for loop has completed, append the figBox node to the document element with the id main.
      
    9. Create the showSheet() function. The purpose of this function is to change the style sheet used in the document. Add the following commands to the function:
     a. Declare the variable sTitle, setting it equal to the title attribute of the inline image that called the showSheet() function. (Hint: Use the this keyword to reference the inline image.)
     b. Loop through all of the sheets in the allSheets array. Enable the style sheet whose title attribute equals sTitle and disable all of the others.
     
    10. Document your work with descriptive comments throughout your code.

    11. Save your changes to the file, and then open accents.htm in your Web browser. Verify that five inline images have been added near the bottom of the Web page. Click each thumbnail image and verify that it loads a different style sheet. (Note: If you are using Safari for Windows or Macintosh Version 5.1.2, this style sheet  switcher will not work.)

    12. Submit your completed files to your instructor, in either printed or electronic form, as requested.

    Learn More
  4. PRG420 Week 4 Individual Assignment Coding a Program Containing an Array Coding and Output

    PRG420 Week 4 Individual Assignment Coding a Program Containing an Array

    Regular Price: $10.00

    Special Price $7.00

    PRG420 Week 4 Individual Assignment Coding a Program Containing an Array

    Individual: Coding a Program Containing an Array

    Includes Working Java Build and Program File and Explanation of Code
    Resource:  Week Four Coding Assignment Zip File (starter code for this assignment that includes placeholders)
    For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program that creates and accesses an array of integers. The Java™ program you write should do the following:
    • Create an array to hold 10 integers
    • Ask the user for an integer. Note: This code has already been written for you.
    • Populate the array. Note: The first element should be the integer input by the user. The second through tenth elements should each be the previous element + 100. For example, if the user inputs 10, the first array value should be 10, the second 110, the third 210, and so on.
    • Display the contents of the array on the screen in ascending index order.
    Complete this assignment by doing the following:
    1. Download and unzip the linked Week Four Coding Assignment Zip File.
    2. Read each line of the file carefully, including the detailed instructions at the top.
    3. Add comments to the code by typing your name and the date in the multi-line comment header.
    4. Replace the following lines with Java™ code as directed in the file:
    • LINE 1
    • LINE 2
    • LINE 3
    • LINE 4
    • LINE 5
    5. Comment each line of code you add to explain what you intend the code to do.
    6. Test and modify your Java™ program until it runs without errors and produces the results as described above.
    Note: Refer to this week's analyzing code assignment if you need help.
    Submit your Java source (.java) code file using the Assignment Files tab.

    /********************************************************************
    * Program:    PRG420Week4_CodingAssignment
    * Purpose:       Week 4 Individual Assignment #2
    * Programmer:    Iam A. Student
    * Class:         PRG/420  PRG420 PRG 420
    * Creation Date:   TODAY'S DATE GOES HERE
    *********************************************************************
    *
    *********************************************************************
    *  Program Summary: This program demonstrates these basic Java concepts:
    *     - Creating an array based on user input
    *     - Accessing and displaying elements of the array
    *
    * The program should declare an array to hold 10 integers.
    * The program should then ask the user for an integer.
    * The program should populate the array by assigning the user-input integer
    * to the first element of the array, the value of the first element + 100 to
    * the second element of the array, the value of the second element + 100 to
    * the third element of the array, the value of third element + 100 to
    * the fourth element of the array, and so on until all 10 elements of the
    * array are populated.
    *
    * Then the program should display the values of each of the array
    * elements onscreen. For example, if the user inputs 4, the output
    * should look like this:
    *
    * Enter an integer and hit Return: 4
    * Element at index 0: 4
    * Element at index 1: 104
    * Element at index 2: 204
    * Element at index 3: 304
    * Element at index 4: 404
    * Element at index 5: 504
    * Element at index 6: 604
    * Element at index 7: 704
    * Element at index 8: 804
    * Element at index 9: 904
    ***********************************************************************/
    package prg420week4_codingassignment;
    import java.util.Scanner;
    public class PRG420Week4_CodingAssignment {
     public static void main(String[] args) {
      
      // LINE 1. DECLARE AN ARRAY OF INTEGERS

      // LINE 2. ALLOCATE MEMORY FOR 10 INTEGERS WITHIN THE ARRAY.

      // Create a usable instance of an input device
      Scanner myInputScannerInstance = new Scanner(System.in);
      
      // We will ask a user to type in an integer. Note that in this practice
      // code  WE ARE NOT VERIFYING WHETHER THE USER ACTUALLY
      // TYPES AN INTEGER OR NOT. In a production program, we would
      // need to verify this; for example, by including
      // exception handling code. (As-is, a user can type in XYZ
      // and that will cause an exception.)
      System.out.print("Enter an integer and hit Return: ");
      
      // Convert the user input (which comes in as a string even
      // though we ask the user for an integer) to an integer
      int myFirstArrayElement = Integer.parseInt(myInputScannerInstance.next());
      
      // LINE 3. INITIALIZE THE FIRST ARRAY ELEMENT WITH THE CONVERTED INTEGER myFirstArrayElement
      

      // LINE 4. INITIALIZE THE SECOND THROUGH THE TENTH ELEMENTS BY ADDING 100 TO THE EACH PRECEDING VALUE.
      // EXAMPLE: THE VALUE OF THE SECOND ELEMENT IS THE VALUE OF THE FIRST PLUS 100;
      // THE VALUE OF THE THIRD ELEMENT IS THE VALUE OF THE SECOND PLUS 100; AND SO ON.

      
      // LINE 5. DISPLAY THE VALUES OF EACH ELEMENT OF THE ARRAY IN ASCENDING ORDER BASED ON THE MODEL IN THE TOP-OF-CODE COMMENTS.
      
     } 
    }

    Learn More
  5. CIS407 Lab 4 PayrollSystem ASP.NET Application frmMain

    CIS407 Lab 4 of 7: Web Forms with Database Interaction PayrollSystem ASP.NET Application

    Regular Price: $12.00

    Special Price $10.00

    CIS407 Lab 4 of 7: Web Forms with Database Interaction PayrollSystem ASP.NET Application

    Lab Overview
    Scenario/Summary
    In this lab, we will start with the form that we created in Week 2 (frmPersonnel) and add functionality to INSERT records into a database table and SELECT records for display to the user. We will create a typed dataset, a Data Layer class, several functions to access the data, and a connection to a database. We also will add a search form to allow the user to search records in the database and display the results of that search. Please watch the tutorial before beginning the Lab.

    Lab Steps
    Deliverables
    All files are located in the subdirectory of the project. The project should function as specified:
    When you press the Submit button in frmPersonnel, a record should be saved in the tblPersonnel table having the FirstName, LastName, PayRate, StartDate, and EndDate that you entered on the form. Add a search feature to the project. Update your main navigation page with the new options. Once you have verified that it works, save your website, zip up all files, and submit it.

    STEP 1: Data Layer
    1. Open Microsoft Visual Studio.NET.
    2. Click the ASP.NET project called PayrollSystem to open it.
    3. Open the clsDataLayer class and add the following function:
    // This function saves the personnel data
    public static bool SavePersonnel(string Database, string FirstName, string LastName,
    string PayRate, string StartDate, string EndDate)
    {
    bool recordSaved;
    try {
    // Add your comments here
    OleDbConnection conn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" +
    "Data Source=" + Database);
    conn.Open();
    OleDbCommand command = conn.CreateCommand();
    string strSQL;
    // Add your comments here
    strSQL = "Insert into tblPersonnel " +
    "(FirstName, LastName, PayRate, StartDate, EndDate) values ('" +
    FirstName + "', '" + LastName + "', " + PayRate + ", '" + StartDate +
    "', '" + EndDate + "')";
    // Add your comments here
    command.CommandType = CommandType.Text;
    command.CommandText = strSQL;
    // Add your comments here
    command.ExecuteNonQuery();
    // Add your comments here
    conn.Close();
    recordSaved = true;
    } catch (Exception ex) {
    recordSaved = false;
    }
    return recordSaved;    
    }

    4. In the frmPersonnelVerified form, go to the Page_Load() event and add the following code after the existing code (but still in the Page_Load event handler):
    // Add your comments here
    if (clsDataLayer.SavePersonnel(Server.MapPath("PayrollSystem_DB.accdb"),
    Session["txtFirstName"].ToString(),
    Session ["txtLastName"].ToString(),
    Session ["txtPayRate"].ToString(),
    Session ["txtStartDate"].ToString(),
    Session ["txtEndDate"].ToString()))
    { txtVerifiedInfo.Text = txtVerifiedInfo.Text + "\nThe information was successfully saved!"; }
    else
    { txtVerifiedInfo.Text = txtVerifiedInfo.Text + "\nThe information was NOT saved.";  }
    5. Add comments for all code containing // Add your comments here.
    6. Test your work to make sure that no errors occur! (Make sure to put in valid date values for the date data entry fields).
    STEP 2: Data Display and Search
    7. Using the skills that you learned in Week 3, create a new DataSet for the tblPersonnel table (call the DataSet dsPersonnel).

    8. Using the skills that you learned in Week 3, create a new function called GetPersonnel in the clsDataLayer class. This function should retrieve all data from the tblPersonnel table and return it in the form of a dsPersonnel DataSet. Use the GetUserActivity function as an example.

    9. Create a new Web form called frmViewPersonnel.

    10. Using the skills that you learned in Week 3, add a GridView control (called grdViewPersonnel) to the form. This GridView control will be used to display data from the tblPersonnel table. Add the ACIT logo at the top of the page and make sure it links back to frmMain.

    11. Add the following code to the Page_Load() function in frmViewPersonnel.
    if (!Page.IsPostBack)
    {
    //Declare the Dataset
    dsPersonnel myDataSet = new dsPersonnel();
    //Fill the dataset with shat is returned from the method.
    myDataSet = clsDataLayer.GetPersonnel(Server.MapPath("PayrollSystem_DB.accdb"));
    //Set the DataGrid to the DataSource based on the table
    grdViewPersonnel.DataSource = myDataSet.Tables["tblPersonnel"];
    //Bind the DataGrid
    grdViewPersonnel.DataBind();
    }

    12. Return to the frmPersonnel Web form and add a button ((ID) = btnViewPersonnel, Text = View Personnel) which, when clicked, will display form frmViewPersonnel.

    13. Open the frmPersonnelVerified form and add a button ((ID) = btnViewPersonnel, Text = View Personnel) which, when clicked, will display form frmViewPersonnel. NOTE: This is the same button with the same functionality that you added to form frmPersonnel in the previous step. Also, add a new link and linked image to frmMain called View Personnel that will go to the new frmViewPersonnel page you created.
    Let's test the View Personnel page. Start your program in Internet Explorer. Click on Add New Employee and add yourself to the database and press Submit. Once you are on the personnel verified form, click the View Personnel button. You should see the data that you just entered.
     
    14. You will now add a Search feature to allow the user to find and display data. The user will enter a last name and the Web application will display the grid of employees with all employees that match that last name.

    15. Create a new Web form called frmSearchPersonnel. Add the hyperlinked ACIT logo to this page. Also, add a new item on frmMain (with a Link button and Image button) called Search Personnel.

    16. On the frmSearchPersonnel form, add a label that displays "Search for employee by last name:". Next to the label, add a text box with an ID of txtSearch. Add a button with an ID of btnSearch and set the text of the button to "Search".

    17. When the frmSearchPersonnel Search button is pressed, the frmViewPersonnel is displayed. At this point, no searching is actually happening, but you have the forms that you need and the navigation is working. Now you can focus on the coding that you will need to do to have the grid only display matching employees.

    18. Before calling the GetPersonnel method that you added previously in the lab, you will need to get the value that is in the Request["txtSearch"] item. When the form posts the search page results to the frmViewPersonnel, the name value pair for the search value is passed as part of the Request object. This value will need to be assigned to a string variable. To do this task, add the following line of code in the code block below to the Page_Load function in frmViewPersonnel after the line: dsPersonnel myDataSet = new dsPersonnel();
    string strSearch = Request["txtSearch"];
    Then, modify the call of the GetPersonnel function one line below to add the strSearch as one of the arguments:
    myDataSet = clsDataLayer.GetPersonnel(Server.MapPath("PayrollSystem_DB.accdb"), strSearch);

    19. Modify the GetPersonnel method that you added in the clsDataLayer.cs class to include a new parameter called strSearch of type string. Add string strSearch as an argument to the function as below:
    public static dsPersonnel GetPersonnel(string Database, string strSearch)
    Then modify the sqlDA select statement within the GetPersonnel function to test if a value is entered for a search parameter.
    if (strSearch == null || strSearch.Trim()=="")
    { sqlDA = new OleDbDataAdapter("select * from tblPersonnel", sqlConn); }
    else
    { sqlDA = new OleDbDataAdapter("select * from tblPersonnel where LastName = '" + strSearch + "'", sqlConn); }
    20. Test the search so that when you enter a last name, employees with that last name are returned. Make sure that when you access frmViewPersonnel and you are not searching, all employees are returned.
    STEP 3: Test and Submit
    Run your project and test it as follows:
    The frmMain form should be displayed first.
    Click on the Add New Employee hyperlink to go to the frmPersonnel data entry form. Click the View Personnel button on this form. The frmViewPersonnel form should be displayed in the browser, but at this point, there should not be very many personnel listed.
    Use the Back button in your Web browser to return to the frmPersonnel form and enter some personnel data for a few employees, similar to the following:
     
    Now, click the Submit button. The frmPersonnelVerified form should be displayed, showing the data you entered, and you should get a message saying that the data were successfully saved, like this example.
     
    You should be able to view the employee records by clicking the View Personnel link on the home page.
     
    Test the Search feature and make sure that entering no search string returns all of the data and that typing in a last name will return all employees with the same last name.

    NOTE: Make sure that you include comments in the code provided where specified (where the " // Your comments here" line appears) and for any code that you write, or else a 5-point deduction per item (form, class, function) will be made.

    Learn More
  6. CIS407 Lab 3 PayrollSystem

    CIS407 Lab 3 PayrollSystem ASP.NET Application

    Regular Price: $12.00

    Special Price $10.00

    CIS407 Lab 3 PayrollSystem ASP.NET Application

    STEP 1: Step Title
    1. Open Microsoft Visual Studio.NET.
    2. Open the PayrollSystem website by clicking on it in the Recent Projects list, or by pulling down the File menu, selecting Open Website, navigating to the folder where you previously saved the PayrollSystem, and clicking Open.
    3. Download the PayrollSystem_DB.accdb file from the Files section and save it on your local computer. (Note: your operating system may lock or block the file. Once you have copied it locally, right click on the file and select Properties and then Unblock if available). Then add it to the PayrollSystem website as follows: In Visual Studio, in the Solution Explorer click Website, Add Existing Item, then navigate to the PayrollSystem_DB.accdb file you downloaded, and click the Add button.
    Make sure you select file types, which include *.accdb, *.accdb, etc. Otherwise, you will not be able to see the database file to select.
    4. Now we need to create a new connection to the PayrollSystem_DB.accdb. To begin, click View Server Explorer.
    5. When the Server Explorer toolbox appears, click the Connect to Database button.
    6. When the Add Connection dialog appears, click the Change button. In the Change Data Source dialog, select MS Access Database File; Uncheck Always use this Selection; then click OK.
    Press Continue to get the following screen.
    7. Click the Browse button to navigate to the PayrollSystem_DB.accdb file in your website folder, then click Open. (NOTE: Be sure you select the PayrollSystem_DB.accdb file in your PayrollSystem website folder, not the one you originally downloaded from the Files section). Click Test Connection. You should receive a message that the test connection succeeded. Click OK to acknowledge the message, then click OK again to close the Add Connection dialog.
    8. The PayrollSystemDB.accdb should be added to the Server Explorer. Expand the database, then expand the Tables entry under the database until you see tblUserActivity. Leave the Server Explorer window open for now as you will be returning to it in a moment.
    9. Create a new dataset by selecting Website-> Add New Item. Under Templates, select the Dataset item. Enter dsUserActivity.xsd for the name. Click Add.
    10. If the following message appears, select Yes. You want to make this dataset available to your entire website.
    11. If the TableAdapter Configuration Wizard dialog appears, click Cancel. (We will be configuring a Data Adapter for this dataset later in C# code, so we do not need to run this wizard.)
    12. Drag-and-drop the tblUserActivity table from the Server Explorer window into the dsUserActivity dataset in the editor window.
    NOTE: If you see a message that says your connection uses a local data file that is not in the current project, that indicates you did not select the correct PayrollSystem_DB.accdb file when you created your data connection. To fix this problem, click No, then right-click on PayrollSystemDB.accdb in the Server Explorer window and choose Modify Connection. Click the Browse button, navigate to the PayrollSystemDB.accdb file that is in your PayrollSystem website folder, and click Open. Test the connection, then click OK.
    Click the Save icon on the toolbar to save the dsUserActivity.xsd dataset.
    (You can now close the Server Explorer window if you wish.)
    13. Create a new class to contain the C# code that will access this dataset. To do so, click Website, Add New Item. In the Add New Item dialog, select the Class template, and enter clsDataLayer for the name. Make sure the Language is set to Visual C#. Click Add.
    14. If the following message appears, select Yes. You want to make this class available to everything in your solution.
    15. Add the following to the top of your class, below any other using statements created for you by Visual Studio.
    Add to top of class
    // Add your comments here
    using System.Data.OleDb;
    using System.Net;
    using System.Data;
    16. Add the following three functions inside the squiggly braces for the public class clsDataLayer class, above the beginning of the public clsDataLayer() constructor and save the class.
    Class
    // This function gets the user activity from the tblUserActivity
    public static dsUserActivity GetUserActivity(string Database)
    {
    // Add your comments here
    dsUserActivity DS;
    OleDbConnection sqlConn;
    OleDbDataAdapter sqlDA;
    // Add your comments here
    sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database);
    // Add your comments here
    sqlDA = new OleDbDataAdapter("select * from tblUserActivity", sqlConn);
    // Add your comments here
    DS = new dsUserActivity();
    // Add your comments here
    sqlDA.Fill(DS.tblUserActivity);
    // Add your comments here
    return DS;
    }
    // This function saves the user activity
    public static void SaveUserActivity(string Database, string FormAccessed)
    {
    // Add your comments here
    OleDbConnection conn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" +
    "Data Source=" + Database);
    conn.Open();
    OleDbCommand command = conn.CreateCommand();
    string strSQL;
    strSQL = "Insert into tblUserActivity (UserIP, FormAccessed) values ('" +
    GetIP4Address() + "', '" + FormAccessed + "')";
    command.CommandType = CommandType.Text;
    command.CommandText = strSQL;
    command.ExecuteNonQuery();
    conn.Close();
    }
    // This function gets the IP Address
    public static string GetIP4Address()
    {
    string IP4Address = string.Empty ;
    foreach (IPAddress IPA in
    Dns.GetHostAddresses(HttpContext.Current.Request.UserHostAddress)) {
    if (IPA.AddressFamily.ToString() == "InterNetwork") {
    IP4Address = IPA.ToString();
    break;
    }
    }
    if (IP4Address != string.Empty) {
    return IP4Address;
    }
    foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName())) {
    if (IPA.AddressFamily.ToString() == "InterNetwork") {
    IP4Address = IPA.ToString();
    break;
    }
    }
    return IP4Address;
    }
    STEP 2: frmUserActivity, frmPersonnel, frmMain
    17. Create a new web form called frmUserActivity. Switch to Design Mode and add the ACIT logo to the page as an ImageButton and link it back to frmMain. Below the image button add a panel. To the panel, add a Label and GridView (found under the Toolbox, Data tab) having the following properties.
    Property Value
    Label – Text User Activity
    GridView – (ID) grdUserActivity
    18. Go to the Page_Load method by double clicking an empty space on the page and add the following code.
    Page_Load method for frmUserActivity.aspx
    if (!Page.IsPostBack) {
    // Declares the DataSet
    dsUserActivity myDataSet = new dsUserActivity();
    // Fill the dataset with what is returned from the function
    myDataSet = clsDataLayer.GetUserActivity(Server.MapPath("PayrollSystem_DB.accdb"));
    // Sets the DataGrid to the DataSource based on the table
    grdUserActivity.DataSource = myDataSet.Tables["tblUserActivity"];
    // Binds the DataGrid
    grdUserActivity.DataBind();
    }
    19. Open the frmMain form, add a new link button and image button to point to the new frmUserActivity. Find an image to use for the image button and add the new option as View User Activity.
    20. Go to the frmMain Page_Load and add the following code.
    frmMain.aspx Page_Load code
    // Add your comments here
    clsDataLayer.SaveUserActivity(Server.MapPath("PayrollSystem_DB.accdb"), "frmPersonnel");
    21. In the Solution Explorer, right click on the frmMain.aspx form and select Set As Start Page. Run your project. When you open the project, a record should be saved in the tblUserActivity table with the IP address, form name accessed (frmPersonnel), and the date accessed. When you click the View Activity button, you should see at least one record with this information.
    23. You will now add server side validation code to the frmPersonnel page. Currently, when the Submit button is pressed, the frmPersonnelVerified page is displayed. This is because the frmPersonnelVerified page is set as the Submit button's PostBackUrl property. Instead of having the page go directly to the frmPersonnelVerified page when the Submit button is pressed, we want to do some server side validation. If any of the validation rules fail, we will redisplay the frmPersonnel page with the fields in question highlighted in yellow with an error message displayed.
    First, it is important to understand what is currently happening when the submit button is pressed. This is causing a postback of the form to the frmPersonnelVerified form. When this postback happens, all of the data in the fields on the frmPersonnel form are sent to the frmPersonnelVerified form as name value pairs. In the Page_Load code of frmPersonnelVerified these values are picked up from the Request object and displayed. Each name value pair will be in the Request object as the ID of the control containing the value and the value itself. We can pass data between pages by using Session state instead. In order to do validation on the values but still have the values visible on the frmPersonnelVerified page, we will need to change not only the PostBack URL of the frmPersonnel page but also how the frmPersonnelVerified form is getting the data—it will need to get it from Session state rather than from the Request object.
    In order to do this, we will make the following changes.
    1. Clear the Submit button PostBackURL Property on the frmPersonnel form. Remove the value in the PostBackUrl that is highlighted.
    2. In the btnSubmit_Click event handler get each value from the data entry fields and set Session state items for each. (instructions below)
    3. Change the frmPersonnelVerified code behind to get the values from the Session state items you created in the previous step. (instructions below)
    When you are done with these steps, you should be able to enter data on the frmPersonnel data entry form and then click the Submit button. The frmPersonnelVerified page should then be displayed with the values that were in the data entry fields on frmPersonnel.
    23. Add a label to the frmPersonnel form with an ID of lblError. Do not place the label to the right or left of any of the controls on the form. Add it below the controls or above the controls. The text property of this label should be set to an empty string.
    24. Add code to perform server side validation in response to the submit button being clicked. Here are the business rules we want to enforce (remember this will be server C# code in the frmPersonnel code behind): Fields may not be empty or filled with spaces. If any field is empty, turn that field background color to yellow and add to/create an error message to be shown in the error label. The end date must be greater than the start date. If the end date is less than the start date, turn both date fields yellow and add to/create an error message to be shown in the error label. If all fields validate properly then the session state items should be set properly and the user should see the frmPersonnelVerified form with all the values displayed.
    frmPersonnel.aspx Lab Hints
    1. The server side validation should be in the Submit button's event handler. There is a Trim method on the string object that will automatically remove spaces from the beginning and end of a string. To test if txtFirstName is empty or filled with spaces, use the following code.
    if (Request["txtFirstName"].ToString().Trim() == "")
    2. To set the background color of the txtFirstName field, use the following code.
    txtFirstName.BackColor = System.Drawing.Color.Yellow;
    3. To set a value in session state and redirect the response to the frmPersonnelVerified.aspx do the following. txtFirstName is the key and txtFirstName.Text is the value.
    Session["txtFirstName"] = txtFirstName.Text;
    //Need to set session variables for all text boxes
    Response.Redirect("frmPersonnelVerified.aspx");
    4. You may want to create variables to work with for validation rather than using the Request item objects directly.
    To turn a string into a DateTime object you can use the DateTime method Parse. If you had a date value stored in a string called strDate, you could turn it into a DateTime object like this.
    DateTime myDateTimeObject = DateTime.Parse(strDate);
    You can compare two DateTime objects by using the DateTime.Compare method. If you had two DateTime objects called dt1 and dt2 you can check to see if dt1 is greater than dt2 by doing this.
    if (DateTime.Compare(dt1,dt2) > 0)
    DateTime.Compare will return a 0 if the two dates are equal, a 1 if dt1 is greater than dt2, and a -1 if dt1 is less than dt2.
    If you put in an invalid date for either of the date fields, you will get an exception/server error when trying to parse the values. We will address this in a later lab—for now make sure you enter valid dates (valid meaning a date in the form of mm/dd/yyyy).
    5. An example of the code you might want to use to test if the end date is after the start date follows.
    DateTime startDate = DateTime.Parse(Request["txtStartDate"]);
    DateTime endDate = DateTime.Parse(Request["txtEndDate"]);
    if (DateTime.Compare(startDate, endDate) > 0)
    {
    txtStartDate.BackColor = System.Drawing.Color.Yellow;
    txtEndDate.BackColor = System.Drawing.Color.Yellow;
    Msg = Msg + "The end date must be a later date than the start date.";
    //The Msg text will be displayed in lblError.Text after all the error messages are concatenated
    validatedState= false;
    //Boolean value - test each textbox to see if the data entered is valid, if not set validState=false.
    //If after testing each validation rule, the validatedState value is true, then submit to frmPersonnelVerified.aspx, if not, then display error message
    }
    else
    {
    txtStartDate.BackColor = System.Drawing.Color.White;
    txtEndDate.BackColor = System.Drawing.Color.White;
    }
    Remember to clear the PostBackURL property of the Submit button!
    frmPersonnelVerified.aspx Lab Hints
    When using the Session state in frmPersonnel.aspx for txtFirstName, you used the following code: Session["txtFirstName"] = txtFirstName.Text;
    To get this same value back from the session we use the key and the Session object in the Page_Load of frmPersonnellVerified.aspx (instead of using Request, use Session) as follows.
    Session["txtLastName"].ToString()
    STEP 3: Verify and Submit
    23. View the video above on what functions your lab should have so far.
    24. Run your project. When you open the project and go to the main menu form a record should be saved in the tblUserActivity table with the IP address, form name accessed (frmPersonnel), and the date accessed. When you click the View Activity button you should see at least one record with this information. The validation and error display should work for entering data. All navigation and hyperlinks should work.
    Once you have verified that it works, save your project, zip up all files, and submit it.

    NOTE: Make sure you include comments in the code provided where specified (where the " //Your comments here" is mentioned) and for any code you write, or else a five-point deduction per item (form, class, function) will be made. You basically put two forward slashes, which start the comment; anything after the // on that line is disregarded by the compiler. Then type a brief statement describing what is happening in the following code. Comments show professionalism and are a must in systems. As a professional developer, comments will set you apart from others and make your life much easier if maintenance and debugging are needed.

    Learn More
  7. CIS407 Lab 1 PayrollSystem Default Page

    CIS407 Lab 1 PayrollSystem ASP.NET Application

    Regular Price: $8.00

    Special Price $5.00

    CIS407 Lab 1 PayrollSystem ASP.NET Application

    In this Lab, you will create an Annual Salary Calculator ASP.NET Web application using Visual Studio.NET.
    For the Labs, you will use the Microsoft Visual Studio software application. You have two options for using this application:
    - You may use a copy of Visual Studio that is installed on your local PC. If you do not already have this software, there is a link in the Syllabus (in the Textbook and Required Materials section) that you can follow to obtain a copy at low or no cost through the DeVry Student Software Fulfillment Center.
    or
    - You may run Visual Studio over the Web from the DeVry Lab (Citrix) server. Instructions for using the Lab (Citrix) server are on the Lab page under the Introduction & Resources Module.
    Throughout this course, you will be creating a Web application for a fictitious company called ACIT (Academy of Computing and Information Technology). To get familiar with the development environment, follow the Lab Steps to create a simple Annual Salary Calculator ASP.NET Web application. You will be adding to this application each week.

    Overview of Fictitious Company
    The Academy of Computing and Information Technology is a mid-size indie (independent) film studio that is in need of a payroll system. We have outgrown our current system, a simple spreadsheet, to the extent that it takes three people over one week to pay everyone on a timely basis.

    Overview of Our Company
    We have over 2,000 full-time and part-time employees. We produce comedy, fiction, and science fiction films with budgets of $250K–$20 million. We have produced over 50 films since we first began 20 years ago.
    We are very profitable and have strong links to many of the industry's most powerful people.

    Current Payroll System
    Our current system consists of mostly manual processing using an MS Excel spreadsheet to control who gets paid.
    The system consists of the three payroll staff members reviewing each of the full-time staff members' wages, calculating how many hours they worked based on their hourly rate, and paying them by issuing a check.
    The check needs to be entered in another worksheet for each of the people who were paid so that we can tell when it went out, how much it was for, and if it was cashed or not. If a [Date_Cashed] is entered, we deduct that amount from our working payroll capital account to track how much money we have for payroll.
    This process is then repeated for all part-time staff and independent contractors.

    Our Needs
    We need a more automated way to pay our staff. We need to use the same logical flow as a basis, yet improve on it by having a way to
    1. easily calculate the projected annual salary based on rate and number of hours;
    2. search, enter, update, and delete staff and independent employee information in one place;
    3. search, enter, update, and delete payroll automation information for the employee to set up recurring payments or one-time payments;
    4. produce reports to show the following: (a) summary of who got paid per week, (b) summary of all payments per week, (c) details of any employee to-date (allow entry of a specific employee ID);
    5. allow transactions to be rolled back in case we pay someone too much;
    6. make use of transaction processing in case the system unexpectedly shuts down;
    7. ensure the system is secure (logins required);
    8. allow only authorized payroll personnel to control all aspects of the system;
    9. allow only authorized payroll personnel to view transactions and user activity;
    10. allow only authorized payroll personnel to e-mail reports to users using the e-mail on file; and
    11. incorporate error handling into all processes in the system and e-mail any errors to the technical support people.

    Required Software
    Microsoft Visual Studio.Net
    Access the software at https://lab.devry.edu (Links to an external site.)Links to an external site..
    Steps: 1, 2, and 3
    STEPs 1–3: Create Website and Home Page
    Please watch this video for a similar example to the one we are doing. It introduces event handlers, getting data from textboxes, performing basic calculations, and formatting the output to be displayed:
    In this Lab, we will learn how to create a simple ASP.NET Web application using Microsoft Visual Studio.NET. The application will display the text "Hello, World" on the home page.
    1. Open Microsoft Visual Studio.

    2. Create a new ASP.NET website called "PayrollSystem."
    To do this, select File -> New -> Web Site

    You will get the following screen which shows Visual Basic.

    Select Visual C# template on the left of your screen if it is not already selected. Notice that your screen will now show Visual C# instead of Visual Basic.

    Click Browse at the bottom of the screen to change Web Location, if necessary to get the screen below.

    Notice that my Web Location is now different.
    Select ASP.NET Empty project and click OK to get the screen below.

    Right-click on the project name from Solution Explorer, then select Add->Add New Item to get the following screen.

    Select Web Form, accept Default.aspx file, and click Add to get:

    Click Design at the bottom left-hand of the window to show the following:

    Edit the Default.aspx file (the home page for your site) to add the message "Greetings and Salutations. I will master ASP.NET in this course."
    To do this, if necessary, click the Design button below the editing window to switch to Design view, then click in the editing window and type " Greetings and Salutations. I will master ASP.NET in this course." (without the quotes) to get the following screen.

    Click the Save button on the toolbar to save the changes to Default.aspx.
    STEPs 4–5: Start Debugging; NOTE: Citrix users have different steps!

    3. To ensure that everything is working properly, click the Start Debugging button on the toolbar, or press the F5 key on the keyboard, or pull down the Debug menu and select Start Debugging.

    Save and run by Right-Click-> Run from Browser.

    Press Yes.

    Click the Start Debugging button on the toolbar, or press the F5 key on the keyboard, or pull down the Debug menu and select "Start Debugging."

    Notice that this time the project build and website validation started.
    If the Debugging Not Enabled dialog box appears, select the option to add or modify the Web.config file to enable debugging and click OK. You should only have to do this the first time you debug the site.
    You will get a clean run just as you did previously. Your output screen looks like the screen below.

    NOTE: To execute the application, you have these options:
    • If you are using Citrix, press CTRL + F5 to Start Without Debugging. You will not be deducted points for this part.
    • If you are using a standalone version, press F5 to Start with Debugging, or you can press CTRL + F5 to Start Without Debugging.
    Create the Salary Calculator Form
    1. Right click on the Project name. Choose Add, then Select Web Form to get the screen below.

    And you get the Add New Item screen, shown below.

    2. Select the name of the form you will add frmSalaryCalculator.aspx. Make sure "Place code in separate file" is checked and "Select master page" is unchecked.
    You will create a Web-based salary calculator on this new page.
    Click the Design view.
    Add the Tools Window using View-> Toolbox.

    3. You can choose to adjust the ToolBox to tab with Solution Explorer to look like the following screen.

    You will create a Web-based salary calculator on this new page.
    To do this, open the aspx page in Design view and, from the Toolbox, drag a label into the form, click after the label and add about 5 spaces, then drag a textbox control after the label.
    Press Enter after the textbox to put the cursor on the next line.
    Add another label and textbox below the first set and press Enter.
    Then add a button control. Finally, on the last line, add another label. Your form should look like the screen displayed below.

    4. If necessary, add the Property Window as shown in the screen below, using View->Properties Window.

    5. Now we will modify the page to add proper labels and give the textboxes names.
    • Change the text displayed in each label so that the first label displays Annual Hours; the second label should display Rate; and the third label should display $.
    • To change the text displayed, click on the label control. This causes the property window to show all properties of the label, then change the Text property of the control in the Properties window.
    • Set the ID property of the top textbox to txtAnnualHours.
    • Set the ID property of the second textbox to txtPayRate. Set the ID of the bottom label (the one we set the text property to "$") to lblAnnualSalary. (Note: We set these IDs as we will be accessing the control values from the C# code. You can set the button ID and the other two labels' ID properties as well, but we won't be accessing them from our code.)
    • Change the button text to display Calculate Salary. (Hint: To change the text displayed as the button label, change the Text property of the button.) The ID of the button should be btnCalculateSalary.Your form should now look like the screen displayed below.

    This code will be called each time the user presses the button. It is important to remember that code in the code behind page executes on the server, not on the user's browser. This means that when the button is pressed, the page is submitted back to the Web server and is processed by the ASP.Net application server on the Web server. It is this code (between the { and } in this method) that will execute on the server. Once it is done executing, the page will be sent back to the browser. Any changes we make to the page or controls on the page will be shown to the user in the updated page.
    • In this method, add code that will get the text in the txtAnnualHours text box, convert it to a Double, and store it in a double variable.
    • Add code that will get the text from the txtPayRate text box, convert it to a Double, and store it in another variable.
    • Create a third variable of type Double and set its value to the annual hours variable value multiplied by the rate double variable value.
    • Take this resulting value and convert it to a string (text), and update the lblAnnualSalary Text property with this new string.
    Let's look at a similar example. After reviewing this example, write the code needed to calculate the annual salary.
    CostOfRoom Calculator is the alternate example, which demonstrates the skills you need to complete this assignment. See video at the top of this lab document and screenshots below.
    What follows is an example of code-behind the Calculate button for the CostOfRoom Calculator:
    Code-behind the calculate button
    A control's property can be accessed by simply using the control ID followed by a . followed by the name of the property. For example, the value stored in the Text property of the txtAnnualHours control can be accessed by using this: txtAnnualHours.Text. Text properties on controls are of type string.
    The output of the CostOfRoom calculator is shown in the screen below with Length, Width, Cost Per Square Unit labels and input boxes, and the Calculations button.

    Use small values for length and width.
    Use large values for length and width and see the formatting of the output.

    To convert a string to a Double you can use the Convert class. If we had a string variable called str1 and a double variable called myNumber, the C# code to convert this would be as follows:

    When converting from one type to another, we are assuming that the value stored in the type being converted is compatible with the type with which we are converting. In the example above, if the value stored in str1 was not a type compatible with a Double (for example, tiger), an error would be raised.
    All of the base types in C# (double, int etc) have a ToString() method that you can call. If you had a double variable that you wanted to convert to a string and set that string to my label's text, you would do the following:
    This would take whatever value was stored in the myNumber Double and convert it to a string.
    Set your new form as the start page by clicking once on the form name in the Solution Explorer and then right-clicking on the form name and selecting Set as Start Page. You can now test your application and make sure it works correctly as you did with the Hello World form above. You can switch back and forth between which form runs when you run your application by setting the different forms as the start page. The final result should look something like the screen below with the Annual Hours, Pay Rate, Calculate Salary button, and result.

    Once you have verified that your project works, save your project, zip all files, and submit it.
    NOTE: Please download and review the Files section files Web Lab and Citrix.zip, which contain information on how to FTP to the DeVry University website and how to use Citrix for the assignments.

    Learn More
  8. Lab 4 Introduction to Classes Box Class CPP

    Lab 4 Introduction to Classes Box Class CPP

    Regular Price: $20.00

    Special Price $15.00

    Out of stock

    Lab 4 Introduction to Classes Box Class CPP

    This lab assignment will be completed by pairs of students. Submissions by individual students will not be accepted under normal circumstances. The intent is that the two students work together. You will create a new class called Box, which represents a rectangular cubiod shape, and demonstrate its use.

    Box Class Mandatory Requirements:
    - Height, width, and depth dimension attributes. Each of these dimensions is stored as a positive real number with a minimum possible value of 0.01. 0 Include a set (mutator) and get (accessor) method for each dimension.
    - If a dimension is set to a value lower than the minimum (0.01), then throw an invalid_argument exception with an appropriate message. Default and parameterized constructor(s). If arguments are not specified when a box is instantiated, then each of the dimensions of the box should be set to 1.0.
    - A method to resize the box. This mutator should have three parameters; one for each of the dimensions.
    - A method to get the volume of the box. This accessor should return height x width x depth.
    - A method to convert the object to a string. This accessor should build a string that neatly displays the dimensions, formatted for output.

    Program Requirements:
    The purpose of the main( ) function in this program is to demonstrate each of the features of the Box class. There is no set expectation for how you should do this but it should be sensible and easy to decipher from looking at the program output.

    Things to Explore:
    You are welcome to explore beyond the mandatory requirements if you wish. Some suggestions you may be interested in include concepts that will be covered in later units:
    - including static members in your class. Consider adding variables to store the minimum and maximum dimensions a box could have. These values would be shared by all Box objects.
    - Creating a derived class. Think of a new class that builds on the Box class. Alternatively, you could create a Rectangle class and derive the Box class from it.
    - Creating arrays/vectors of objects, or use a pointer to dynamically allocate objects. You could try this out in your demo program.

    General Requirements
    • Include an opening comment with both partners' names, the name of the program, the date, and a short description.
    • Follow the course coding standards! Use descriptive names and sensible data-types for variables, constants, functions, etc. that follow our naming conventions. • Use good spacing and make sure braces ({}) are located where they are supposed to be and indentation follows Allman style.
    • Attach an unzipped source code file (.cpp) to the assignment folder. Nothing else please.

    Learn More
  9. Lab 2 Logic Structures scoring application for an archery competition

    Lab 2 Logic Structures scoring application for an archery competition

    Regular Price: $20.00

    Special Price $15.00

    Lab 2 Logic Structures scoring application for an archery competition

    In this project you will be writing a scoring application for an archery competition. For the purpose of this assignment, assume that the competition will be divided into four ends (rounds). Three archers will compete. You will create a console C++ program that uses a nested loop to enter each archer's individual end scores and then displays the total score for each archer. Also calculate and display the overall average end score.
    Note: This lab does not require the use of arrays. Do not use them. We will write a similar program with arrays later in the course.

    Input/Output Sequence
    The program should prompt for each of the end scores for the first archer, then display the first archer's total score before moving on to the next archer. The overall average end score is the last output displayed.
    Input Validation Include domain (range) validation in your solution. The lowest score an archer can have for one end is zero. The highest is 60 (based on six arrows). If the user enters a value outside of that range, the program should display an error message and re-prompt. Validation for non-numeric input is also required.

    Processing and Output
    Target archery scores are always whole numbers. Display the average scores to one decimal place.

    General Requirements
    • Include an opening comment with your name, the name of the program, the date, and a short description.
    • Follow the style guide! Use descriptive names and sensible data-types for variables, constants, arrays, functions, etc. that follow our naming conventions. Use good spacing and make sure braces ({}) are located where they are supposed to be.
    • Attach one unzipped source code file (.cpp) to the assignment. Nothing else please.

    Learn More
  10. Willet Creek Golf Course Landscape Orientation

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 8 Case 2 Willet Creek Golf Course

    Regular Price: $15.00

    Special Price $12.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 8 Case 2 Willet Creek Golf Course

    Willet Creek Golf Course Willet Creek is a popular golf course resort in central Idaho. You’ve been asked to work on the design of the resort’s Web site by Michael Carpenter, the head of promotion for the resort. He would like you to add some CSS3 visual effects for drop shadows and gradients. Figure 8-66 shows a preview of the screen version of the Web page.

    Complete the following:
    1. In your text editor, open the willettxt.htm and wceffectstxt.css files from the tutorial.08\case2 folder included with your Data Files. Enter your name and the date in the comment section of each file. Save the files as willet.htm and wceffects. css, respectively.

    2. Go to the wceffects.css file and create a shadow effect for the body element. The effect should contain two box shadows, both with a color value of (31, 61, 31) and an opacity of 0.9. Place the first shadow with a horizontal offset of 20 pixels, a vertical offset of 0 pixels, and a blur of 25 pixels. Do the same for the second shadow, except place the shadow with a horizontal offset of 220 pixels.

    3. Set the opacity of the div elements nested within the aside elements to 75%. Use both the CSS3 opacity style and the IE Alpha filter. Add a box shadow that has a color value of (101, 101, 101) with an opacity of 0.7. Set the horizontal and vertical offsets to 5 pixels and the blur to 10 pixels. You do not have to add an IE filter for the box shadow.

    4. Save your changes to the file, and then return to the willet.htm file in your text editor. Add a link to the wceffects.css style sheet file, using the style sheet for screen devices that have a minimum width of 501 pixels. Add the same media query for the wclayout.css style sheet file.

    5. Use an Internet Explorer conditional comment for versions of IE before version 9 to link to the wclayout.css and wceffects.css style sheet files for screen devices.

    6. Save your changes to the document, and then open the willet.htm file in your Web browser. Verify that the appearance and layout of your page resemble those shown in Figure 8-66.

    7. Many golfers playing the courses at Willet Creek like to receive information and advice about each hole. Michael would like you to create a mobile version of the Web page so that golfers with mobile devices can view information about the course during their rounds. Figure 8-67 shows a preview of the Web app you’ll create.

    8. Open the wcmobiletxt.css file from the tutorial.08/case2 folder in your text editor. Enter your name and the date in the comment section of the file, and then save it as wcmobile.css.

    9. Within the style sheet file, add a style rule to hide the navigation list in the header, the inline image in the header, the main section, the aside
    element, and the page footer.

    10. Set the background color to the value (107, 140, 80).

    11. For the header element, create a style rule to: a) change the background color to the value (151, 201, 151) with the image file willet.jpg placed in the left-center of the background with no tiling; b) set the size of the background image to contain; c) set the width to 100%; and d) set the height to 50 pixels.

    12. The navigation list containing links to each of the 18 holes in the Grand Course has the id holes. Create a style rule to set the width of this navigation list to 100%.

    13. For h1 elements within the holes navigation list, create a style rule to: a) set the font size to 25 pixels; b) set the font color to white; c) set the margin to 15 pixels; and d) center the text of the heading.

    14. For list items in the holes navigation list, create a style rule to: a) display the items as blocks; b) add the background image file arrow.png to the right-center of the background with no tiling; c) set the width to 60% and the height to 50 pixels; d) add top and bottom margins of 5 pixels, and add left and right margins of auto; e) add a 1-pixel-wide solid white border to each list item and create rounded borders with a radius of 10 pixels; and f) add inset box shadows to the list items with a color value of (51, 51, 51) and an opacity of 50% (the inset shadows should appear in the lowerleft corner of each list item with a horizontal offset of 10 pixels, a vertical offset of 5 pixels, and a blur of 20 pixels).

    15. For hypertext links within each list item, add a style rule to: a) display the link as blocks; b) set the width to 100% and the line height to 50 pixels; c) set the font color to white; and d) horizontally center the text of the link.

    16. For odd-numbered list items, set the background color to the value (187, 105, 123). (Hint: Use the pseudo-class nth-of-type(odd).) For even-numbered list items, set the background color to the value (150, 80, 100).

    17. The preceding styles will be applied by default to the page in portrait orientation. Create an @media rule for the page in landscape orientation.

    18. Add the following style rule for list items displayed in landscape orientation: a) set the width to 30%; b) float the list items on the left; and c) set the margins to 5 pixels.

    19. Save your changes to the style sheet, and then return to the willet.htm file in your text editor.

    20. Within the willet.htm file, insert a viewport meta element.

    21. Create a link to the wcmobile.css file to be accessed by only screen devices with maximum widths of 500 pixels.

    22. Save your changes to the file, and then open the willet.htm file in your mobile device or with your browser window resized to a width of less than 500 pixels. Verify that for smaller screen widths, the mobile version of the page is displayed. Further verify that the layout of the links to individual holes changes depending on whether the page is in portrait or landscape orientation.

    23. Submit your completed files to your instructor.

    Learn More

Items 21 to 30 of 168 total

per page
Page:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Grid  List 

Set Ascending Direction
[profiler]
Memory usage: real: 15466496, emalloc: 14708552
Code ProfilerTimeCntEmallocRealMem