Category: Computer Science

  • Computer Science Question

    Unified Modeling Language (UML) Exercise

    UML Exercise for an online bookstore system

    Scenario:

    “Readers’ Haven” is an emerging online bookstore that provides a vast array of physical and digital books for sale. Recently they expanded their services to offer book rentals, customer reviews, personalized reading recommendations, and book rentals; their system must now manage this as well as user profiles, transactions, and feedback from customers.

    Specific features and requirements to consider:

    User Profiles: Each customer is assigned an account with unique attributes like UserID, Name, Email Address, Address, and Reading Preferences. Admin accounts also exist to manage content and transactions.

    Catalog Management: Books are organized into genre, author, publication date, and price categories for easier management. Each title also features additional attributes like BookID, and Title Author Genre Price Availability.

    Transactions: Customers have the option to either rent or buy books, with transaction tracking details such as TransactionID, UserID, BookID, Transaction Date, and Type (purchase/rental). In both instances, the Total Amount must also be kept track of.

    Customer Feedback: After reading, customers can provide reviews and ratings of books. Each review includes ReviewID, UserID, BookID, Rating, and Comment information.

    Recommender System: Based on user reading preferences and purchase history, this system offers tailored book recommendations.

    Assignment: Your task is to create a UML diagram for Readers’ Haven using the provided scenario and accurately represent its entities, their attributes, relationships, and interactions.

    Instructions: Create and document primary classes and objects related to your scenario. Define attributes and methods for each class. Establish relationships (association, aggregation, inheritance) between them.

    Create an in-depth UML diagram that depicts your system’s structure and behavior, along with an explanation of why certain design choices were made.

    Submit your UML diagram and its accompanying explanations for evaluation, making sure it satisfies the scenario’s requirements and displays your in-depth knowledge of system modeling (LO4 & LO5).

    Essential Activities:

    1. Reading Chapters 10-11 will assist you with this exercise.
    2. Watching the video UML Use Case and Sequence Diagrams Made Simple will assist you with this exercise.

    Notes:

    1. This paper must be formatted in APA Style 7th edition.

    Requirements: 900 words explaination and screenshots

  • Assessment 4 Graphs, Tree Graphs, and Adjacency Matrices-205…

    DIRECTIONS – log on to https://courseroom.capella.edu/

    username – ***********************

    password – Blessed2025!

    1. click on course –

    click on assessment- 4

    then click on activity 1- then take quiz

  • Assessment 10 Query Strings and Storing Persistent Informati…

    1. Directions – Download and unzip the file. The unzipped file tree includes the confirm.html page, the CSS for the page (in the css subdirectory), and the JavaScript file to be completed for the confirmation page (js/read.cookies.js).
    2. From your Assessment 9, copy the registration.html file and place it in the top-level directory for this assessment.
    3. Edit the form tag in the registration.html file so that it has its action set to confirm.html like this:
    • <form action=”confirm.html” id=”reg-form” class=”registration-form”>
    1. Copy the JavaScript file from your Assessment 9 and place it in the js subdirectory for this assessment.
    2. Copy the CSS file from your Assessment 9 and place it in the css directory for this assessment. For this final assessment, it will be fine to have two different CSS files in the project.
    3. Edit the JavaScript for the registration page (from Assessment 9).
    • Add a function called writeCookieData(). This function should loop over the input controls (other than the submit button) and clear any previously stored cookies with data for these fields by setting the cookie’s value to empty string (“”) and setting the cookies expiration date to a time sufficiently far in the past.
    • The writeCookieData() function should then loop over the form inputs (other than the submit button) and write the data for each field to a cookie. Use the form field’s id as the name of cookie and the value in the form as the value for the cookie.
    • The last line in the writeCookieData() function should submit the form by calling form.submit() (where form is the variable used to access the form, so change the name as needed).
    • Revise the code for the submit button’s click event handler so that if the form data is valid, the writeCookieData() function is called (but only if form data is valid).
    1. Edit the JavaScript for the confirmation page (in the js/read.cookies.js file).
    • Complete the code for the display CookieValue() function so that it first locates the output area (the div with the id output) on the confim.html page. The code should then loop through the cookies and display the names of the cookies and the values in the output area in a readable format.
    • Complete the code for the window.onload so that the displayCookieValue() function is called when the page has loaded.
    1. Test the registration form page in a browser to confirm that it validates the form and sends the user to the confirmation page if the form is valid (or remains on the registration page if the form is not valid). When the user is sent to the confirmation page, confirm that the cookie data is displayed correctly in a readable format.

    Document this testing with screenshots and place the screenshots in a Word document. Include a brief caption or title with each image to identify what it shows.

    Assessment examples: You may use the assessment examples in the file to give you an idea of what a Proficient or higher rating on the scoring guide would look like.

    Walkthrough: You may view the following walkthrough videos to help you complete this assessment:

    • .
    • .

    Zip up the completed project for this final assessment and submit the zip file, along with the Word document with the screenshots.

  • Assessment 8 Dynamic Images, Events, and the DOM- 3240 -pt 8

    Directions – Index Page

    1. Open the index.html file and the js/image.switcher.js file.
    2. Study the existing HTML and note the elements used. The HTML displays the first image to avoid a broken image icon. The images that the JavaScript for the page needs to cycle through are images/banner1.jpg, images/banner2.jpg, and images/banner3.jpg. Each image will take the place of the existing image displayed by the HTML (don’t add more images to the page).
    3. In the JavaScript file (js/image.switcher.js), add a function that will preload the images. The function that preloads the images should include a parameter that allows passing the list of images to the function as an array. There should not be any specific file names “hard coded” in the function.
    4. In the same JavaScript file, write a function that handles the switching of the image ever) three seconds.
    • This can be done a couple of different ways:
    • Using setTimeout() at the end of the switching function to call the switching function recursively.
    • Using setlnterval() called from the window.onload function (see below) to invoke the switching function at regular intervals. (This is probably the easier approach.)
    1. Preview the page in a browser. Get screenshots showing the switching through the three images and put the screenshots in a Word document. Add captions/notes identifying each image.

    Gallery Page

    1. Open the galley.html page and study the HTML. Preview the page in a browser and note how the existing CSS handles things when the mouse hovers over an image. As CSS has developed, it has taken over a number of interactions that used to be possible with JavaScript. There are still many interactions that CSS can’t handle, so this is where JavaScript comes in.
    2. In the HTML, note the following section, since it will play a key role in this part of the assessment:
    • <section id=”details”>
    • </section>
    1. Open the js/gallery.js file and read through its existing content. Note the existing window.onload() code, which will call the functions you will add the in the steps below
    2. Add a showlmage() function that takes a parameter named e (to pass information about the mouse event). This function will be called when the user clicks the mouse on an image.
    3. This function should use document.getElementBY.ld() to access the details section. Then, the function should use code like the following to get just the file name of the image that the user clicked on:
    • let img = e.target
    • // pop() returns the last item in the array created by split()
    • let fileName = img.src.split(‘/’).pop()
    1. Use the fileName for the image to create a string of HTML to display a larger version of the image clicked on and some text about the image. This HTML is not a complete page but will be inserted as the innerHTML for the details section. The CSS provided includes some styles for #details, .details-image, and .details-caption that you can use or modify, or you can add our own CSS to the .css file to style the details section of the gallery page. Just remember that you should not embed any CSS directly in the HTML.
    2. Set the innerHTML properly for the details area using the string of HTML created above.
    3. Create a clearlmage() function that will clear the details area. This function will be called when the user moves the mouse off of the image.
    4. Test the gallery page to make sure it works correctly. Take at least four screenshots to show that the page works correctly. (You don’t need to get a screenshot of eve possible interaction, just a sample). Add captions/notes identifying each image.

    Keep all JavaScript in the specified .js files in the js subdirectory. There should not be any JavaScript (or CSS) in the HTML.

    Be sure to document the JavaScript that you add with comments.

    Assessment examples: You may use the assessment examples in the file to give you an idea of what a Proficient or higher rating on the scoring guide would look like.

    Walkthroughs: You may view the following walkthrough videos to help you complete this assessment:

    • .
    • .
    • .

    Zip up the folder with the website for this assessment and submit it along with the Word document containing the screenshots. Please be sure that you submit your completed version of the code, not the starter code.

  • Assessment 7 Using Arrays and Loops -3240 -pt 7

    1. Directions – Complete the code for the displayVolunteers() function using a loop, so that it displays the names of the volunteers entered in a numbered list with the last name first, followed by a comma, a space, and the first name. Here is an example (remember: the numbers indicate list position and are not part of the name):
    2. Jones, Pam
    3. Smith, Ann
    4. Davis, Dave
    • Keep in mind that the numbers are not stored in the array as part of the name. They need to be added by the code in displayVolunteers().
    • The addVolunteer() function is already completed, so you can test the dislpayVolunteers() code by entering names in the input fields and clicking the Add button.
    1. Complete the code for the deleteVolunteer() function so that when the user enters a name in the input fields, clicking the Delete button will remove that volunteer from the array and the list.
    • You can locate the name to be deleted from the array using a loop or using the indexOf() function.
    • Use the splice() function to remove the item from the array.
    • Note that the deleteVolunteer() function already includes a call to displayVolunteers() that will update the displayed list after a name has been deleted.
    • The code already in deleteVolunteer() clears the input fields and set the focus to the first name input field.
    1. Complete the clearVolunteers() function that it clears the array and then calls displayVolunteers() to update the list of volunteers (which should be empty).
    2. Complete the sortVolunteers() function so that it sorts the names in the array alphabetically. Then, call displayvolunteers() to update the list.
    3. The final section of the existing code associates the JavaScript functions with the corresponding buttons on the form. You don’t need to modify this code, but it’s good to note what it does.
    4. Carefully test the page to make sure that the buttons work properly. Take at least six screenshots to document the successful testing of the page. Put the screenshots in a Word document and add brief text with each image to indicate what part of the testing it shows. Please do not attach the individual image files to the submission.

    Hint: Use the splice function in order to remove a specific item from the array.

    Tip: The array index starts at 0, so when displaying the index, you will need to add 1 to the index value when it is displayed.

    Make sure to do the following:

    • Write JavaScript to delete a specific volunteer by using a loop.
    • Write JavaScript that loops through the volunteer list to display the index value.
    • Once completed, view your pages in your selected web browsers to see if the content renders appropriately and consistently within each. Next, ensure that your HTML code is HTML5 compliant and your CSS code is valid. You may choose to make use of AI to validate your code and help you troubleshoot and test your code if you do run into errors and issues. You may use the Markup Validation Service for testing the former and CSS Validation Service for testing the latter, both from W3C. Both of these services are free and you can find their links on the reading list. Important: Take a screen capture of each of your validation results and save it for submission.

    Assessment examples: You may use the assessment examples in the file to give you an idea of what a Proficient or higher rating on the scoring guide would look like.

    Zip up the folder with the completed work for this assessment (please keep the files in their original locations; don’t change any file names) and submit the zip file along with the Word document containing the screenshots.

  • Assessment 6 Using Variables in a Form – 3240 – pt 6

    Directions- This assessment requires you to complete the JavaScript code for processing the form. You will find the JavaScript in the js folder in the IT-FPX3240 Assessment 6 zip file. The JavaScript (in the invitation.js file) is half finished, with the code for handing the name entered in the form for the recipient. Using the existing code as a model, you should add the lines of JavaScript needed to read the form input field with the host’s name, store it in a variable, and then update the code so that the JavaScript inserts the host’s name in the span with the id host-placeholder.

    Steps:

    1. Looking at the code in invitation.js, note how the existing JavaScript code declares a variable:
    • let myRecipientName;
    1. Add a line to declare a variable for the host name.
    2. Look at the line that reads the value entered for the recipient’s name:
    • myRecipientName = document.getElementById(“recipient-input”).value
    1. Add a line to read the entry in the form field with the id host-input and store it in the variable for the host name.
    2. To help confirm that the code works as it should, note this line that writes to the developer tools console:
    • console.log(‘Variable myRecipientName: ‘ + myRecipientName)
    1. Add a line that calls the console.log() function to log the value in the variable for the host name.
    2. Observe how the existing code inserts the value in the variable for the recipient’s name into the corresponding span in the output text:
    • document.getElementByld(“recipient-placeholder”).innerHTML = myRecipientName
    1. Add a similar line to replace the host-placeholder text with the host’s name.
    2. Confirm that the form and the JavaScript work as required by opening the HTML form page (invitation.html) in a web browser. Fill in the form and click the submit button. You should see the output area appear below the form. The text in the output should reflect the values entered in the form’s fields.
    3. Add comments to the JavaScript code to document the lines you have added.

    Capture a screenshot showing the invitation page with the values entered in the form and the corresponding output below the form. Put the screenshot in a Word document. There is no external validation service for the JavaScript. You don’t need to validate the HTML and CSS provided.

    Note: Errors from the validation should be fixed. However, warnings do not need to be fixed but should be reviewed. Fix the issues from the top down, as one error can cascade into 20 other errors. Remember, for the assessments in this course, be sure to test your web pages in at least two browsers.

    Assessment examples: You may use the assessment examples in the file to give you an idea of what a Proficient or higher rating on the scoring guide would look like.

    The JavaScript that you use in the assessments should:

    • Rely on plain JavaScript (no frameworks) that has been covered in the course or resources provided in the instructions.
    • All JavaScript must be in separate .js files (not embedded in the HTML).
    • Render and function properly in at least two of the following browsers: Chrome, Firefox, Edge, and Safari.
    • Be verified to be error-free, well-documented with comments, and appropriately constructed.

    Put the Word document with the screenshot in the folder with the files for the assessment. Zip up the folder and submit the zip file with the completed JavaScript for the assessment. Please be careful not to submit the original zip file with the starting version of the code.

  • Assessment 5 Creating a User Form-3240 -pt 5

    1. Directions – Create a user-friendly and professionally designed input form on the Contact Me page. The form should be contextually relevant for the site’s purpose and intuitive for the user. At a minimum, the form must include the following functioning tags:
    • Fieldset.
    • Legend.
    • Label.
    • Textfield.
    • Textarea.
    • Radio buttons.
    • Checkboxes.
    • Select list.
    • Submit button.
    1. Style the form using CSS in the external CSS file used by the pages for the site so that the form has the same look and feel as the rest of the pages.
    2. Download and unzip the JavaScript file provided in the file. Place the script.js file in the same directory as the HTML files for your site.
    3. Add this script to the HTML file with web form by adding the following line of HTML code just above the closing </body> tag:
    • <script src=”script.js”></script>
    1. Edit the <form> tag for the form so that it reads:
    • <form id=”webForm” action=”#”>
    1. Add this line below the HTML for the submit button or after the closing </form> tag to read and display the user’s input when the submit button is clicked:
    • <p><div id=”output”></div></p>
    • This div must have the id “output” (all lowercase letters).
    • The id must be set to “webForm” (lowercase w, uppercase F).
    • The acWon must be set to”#” (no GET or POST method).
    1. Confirm that the revised contact page with the form is valid HTML5 by using W3C HTML validator to check it: .
    • Warnings are okay, but any errors need to be corrected.
    • Put a screenshot of the successful HTML validation in a Word document.
    1. Confirm that the revised CSS file is also still valid CSS3 by using the W3C CSS validator: .
    • Put a screenshot of the successful CSS validation in the same Word document.
    1. Test the form page in two browsers to confirm that the form displays and works correctly. Indicate which two browsers you used in the Word document with the validation screenshots.

    Make sure to do the following:

    • Create a web form that functions per specifications.
    • Submit error-free HTML and CSS code.
    • Create a user-friendly layout for a web form.
    • Fix any rendering or syntax errors encountered in the HTML or CSS code.
    • Use descriptive variable names appropriately and consistently.

    Once completed, view your pages in your selected web browsers to see if the content renders appropriately and consistently within each. Next, ensure that your HTML code is HTML5 compliant and your CSS code is valid. You may choose to make use of AI to validate your code and help you troubleshoot and test your code if you do run into errors and issues. You may use the Markup Validation Service for testing the former and CSS Validation Service for testing the latter, both from W3C. Both of these services are free and you can find their links on the reading list. Important: Take a screen capture of each of your validation results and save it for submission.

    Assessment examples: You may use the assessment examples in the file to give you an idea of what a Proficient or higher rating on the scoring guide would look like.

    Note: Errors from the validation should be fixed. However, warnings do not need to be fixed but should be reviewed. Fix the issues from the top down, as one error can cascade into 20 other errors. Remember, for the assessments in this course, be sure to test your web pages in at least two browsers.

    Zip up the folder containing your complete site (including the script.js file) and submit it (along with the Word document) as this assessment.

  • Assessment 3 Page Layout With CSS -3240 – pt 3

    Directions – The assessment focuses on using CSS for page layout. You will be using CSS layout techniques such as CSS flexbox and CSS grid to give your pages a consistent but flexible layout.

    Start with the index.html file. Revise your CSS and edit the index.html (homepage) so that the overall page layout is responsively handled by either CSS Flexbox (also just called “flex”), CSS Grid, or a combination of the two.

    • The layout should avoid requiring the user to scroll horizontally to see the content as the size of the browser window changes (though when the window is very narrow, horizontal scrolling may be unavoidable).
    • Remember that all CSS must be in the external stylesheet (.css file).
    • All pages should use the same CSS file.
    • Make sure that your page includes enough text and at least a couple images to demonstrate that the layout works for our content.
    • Document the added/revised CSS and HTML with comments.

    Take the layout approach from the index/homepage and apply it to the site’s other pages so that they have a similar overall layout (at least in terms of the top of the page, the navigation area, and the footerserving as a kind of frame).

    • The layout and styling of specific content areas on each page may vary depending on the contents, but the site’s pages should look like they go together.

    On either the About page or the Contact Information page, use an HTML table styled with CSS to present tabular data.

    The HTML table should consist of three or more rows (with table column headers, <th>. . .</th> in the top row) and at least two columns.

    On the gallery page, set up at least two dynamic columns within the overall layout to display the images.

    • You will need to have at least three or four images to make sure the layout works well.
    • The layout of the images should be flexible and adapt to the width of the browser window.

    Test your pages in two different browsers to make sure the work as expected. You don’t need screenshots of these tests. Just state in a Word document which browsers you tested the pages in.

    Validate your pages and CSS using the W3C services:

    • HTML: .
    • CSS: .
    • Warnings (in yellow) are okay, but any errors (in red or pink) need to be corrected.
    • Take screenshots of the successful validations and put them in the Word document.

    Assessment examples: You may use the assessment examples in the file to give you an idea of what a Proficient or higher rating on the scoring guide would look like.

    Note: Errors from the validation should be fixed. However, warnings do not need to be fixed but should be reviewed. Fix the issues from the top down, as one error can cascade into 20 other errors. Remember, for the assessments in this course, be sure to test your web pages in at least two browsers.

    Include the Word document in the folder with the files for your website. Be sure to include just the HTML and CSS files for the assessment (leave out “extra” or unused files). Also make sure that the folder contains the image files used on your pages. Zip up this folder and submit it as this assessment.

  • Assessment 2 Externally Linked CSS and Site Navigation Instr…

    Directions- Create an external CSS stylesheet to style the text, colors, and navigation links used on your web pages. Also update your index “homepage” from Assessment 1 to use the new stylesheet and adding four new pages to your site as specified below.

    1. Add an external CSS stylesheet to your website. The file should be named styles.css. You will define the styles for your web pages in this file, and all HTML files should link to this common CSS file. Don’t create separate stylesheets for each page.
    2. Create CSS3 compliant styles that will provide a consistent look and feel for the pages on your website.
    3. Write CSS3 style rules to govern how text is displayed by defining properties such as:
    • Font family.
    • Font size.
    • Font color.
    • Font style.
    • Font weight.
    • Text margins
    • Text padding.

    In addition:

    • Apply the styles to various parts of the page, such as:
    • Headers/headlines.
    • Text used in the body of the page.
    • Images.
    • Background (image or color).
    • Navigation (use a styled unordered list to provide navigation links) and other hyperlinks on the page.
    • Consider using Google Fonts to have access to a wider range of web fonts that work on all platforms. See .
    • Be sure to document the CSS file with comments to explain how the styles are used.
    • Use a variety of CSS selectors to apply styles to page elements based on tag name, class, and id.
    • Add a link tag to your index.html file in the (<head> section) and add the necessary classes and ids that are needed to apply the styles to the relevant parts of your index page. All CSS should be in the external stylesheet. There should not be an inline or embedded CSS in the HTML.
    • Try to use semantic tags, such as <nav>, <article>, <main>, <header>, <footer>, and <section> instead of <div> tags, where possible, though you may use <div> tags when there are no better elements for the job.
    • Once you have the CSS styling your index page as intended, add the following four HTML files to your site files:
    • about.html (“About Me” or “About Us” depending on the focus or theme for your site).
    • interests.html (“My Interests”) or specialties.html (Our Specialties).
    • gallery.html (for related images). This page just needs a couple of images in this assessment. More will be added in future assessments.
    • contact.html (for relevant contact information).
    • Update the hyperlinks in the styled navigation area on the index page to reflect the pages on your site.
    • Add appropriate content to the four new pages and apply the styles defined in the shared, external CSS stylesheet. Be sure to include HTML comments in the source code to document the pages. As noted above, the gallery page for this assessment just needs a couple of images.
    • Using the W3C validation services, validate the CSS file and the five HTML files. Capture a screenshot of the results of each W3C validation. Place the validation screenshots in a Word document (don’t submit image files for the screenshots). Validation warnings are okay, but you need to correct any errors pointed out by the validation services.
    • .
    • .
    • You should also test all pages in two different browsers on your computer. You don’t need to get screenshots of these tests. Just include a statement in the Word document stating which browsers you tested the pages in.

    Assessment examples: You may use the assessment examples in the file to give you an idea of what a Proficient or higher rating on the scoring guide would look like.

    Note: Errors from the validation should be fixed. However, warnings do not need to be fixed but should be reviewed. Fix the issues from the top down, as one error can cascade into 20 other errors. Remember, for the assessments in this course, be sure to test your web pages in at least two browsers.

    Submission Requirements

    Place the HTML files, the CSS file, image files used for your site, and the Word document in a folder and zip that folder. Submit the zip file as the attachment for this assessment.

  • Computer Science Question

    answer the 10 questions in the attachment

    Requirements: short