1 Web Programming Assigned: Nov. 20, 2020 Due: Nov. 27, 2020 @2355 Version: 0.1.0 Problem 1 (10 points) Create a single HTML document that presents two different appearances, determined by the...

1 answer below »
See pdf


1 Web Programming Assigned: Nov. 20, 2020 Due: Nov. 27, 2020 @2355 Version: 0.1.0 Problem 1 (10 points) Create a single HTML document that presents two different appearances, determined by the document's CSS stylesheet. Your HTML file should be called p1.html and the two stylesheets should be called p1a.css and p1b.css. If the HTML file links to p1a.css then it should appear like this ("Version A"), assuming you are running Chrome 86.0 on a Windows 10 machine: 2 If the HTML file links to p1b.css then it should appear like this in Chrome 86.0 on Windows 10 ("Version B"): Here are some additional details and requirements for this problem: • The content should be described in a single HTML file, using a element to display the main table. • There may not be any formatting information in the HTML file other than class and id attributes. • The appearance must be generated entirely with CSS style information; you may not use images or JavaScript for this problem. • The only change that should be required to switch from Version A to Version B is to change the element in the header to refer to a different CSS file. • Your CSS files must appear in a directory called styles/. • Try to duplicate the appearance in the images above exactly ("pixel perfect"). For example: o Some of the columns should be right-justified whereas others are left-justified. o The "Total" line appears only in Version B (hint: you may find the display attribute useful in producing this effect). o The title in the browser title bar should read "CS 2190 Project 3, Problem 1". o Both versions use the Gill Sans font in a 13-pixel size. o The background colors for the body rows in Version A are #eeeff2 and #dfe1e7. o The lines between the rows in Version A are 2 pixels wide with a color of #d0d0ff. o The color for the frame around Version B is #687291. o The frame in Version B is 10 pixels wide; there are 20 pixels of empty space on either side of the frame. o The frame in version B has a border radius of 15 pixels at each corner. o The horizontal rule above the "Total" line in Version B is 2 pixels wide. o Match the paddings and spacings as closely as possible. • Your HTML file must be a valid XHTML document that passes validation at http://validator.w3.org, and your CSS files must pass validation at http://jigsaw.w3.org/css-validator/ Problem 2 (15 points) Write the XHTML code to create a form with the following capabilities: http://validator.w3.org/ http://jigsaw.w3.org/css-validator/ 3 • Text widgets to collect the clerk ID, constituency ID, polling division ID, polling station, votes for candidate 1, votes for candidate 2, rejected ballots, and total number of votes. • You should also include a hidden field with the value “e11869d1186d0791”. • When the Submit button the form is clicked, a JavaScript validation function must be run. This function should ensure that 1. None of the fields listed above is empty. 2. All the fields except for the polling station are integers. 3. The polling station field contains alphanumeric values, i.e., [A-Z,0-9] 4. The total votes field must be equal to the sum of the votes for candidate 1, candidate 2, and the rejected votes. • The title in the browser title bar should read “Vote logging form” • The form should use the Gill Sans font in a 13-pixel size. • If an error is detected in a field during validation, that field should be colored in red. • Your HTML file must be a valid XHTML document that passes validation at http://validator.w3.org, and your CSS files must pass validation at http://jigsaw.w3.org/css-validator/ Problem 3 (35 points) For this problem you will use a database named “VoteLogDB. Use the database username “comp2190SA” with the password “2020Sem1”. The VoteLogDB should contain a table called StationVotes. The fields of the table are as follows: Field Data type Constituency_id Integer Clerk_id Integer Poll_division_id Integer Polling_stn String Candidate1Votes Integer Candidate2Votes Integer RejectedVotes Integer TotalVotes Integer recordDigest String ID Integer, autonumber Write a PHP script that collects the data from the form described in Problem 2 and stores all the fields in a database. Your code should verify that the data is valid before storing it. Valid data means that the conditions listed in Problem 2 are satisfied. After each new and valid set of votes is submitted, print the contents of the database to a table that is formatted as in Problem 1-b. You do not need to print either the clerk_id or the recordDigest. For now, we will ignore the computation of the recordDigest field. http://validator.w3.org/ http://jigsaw.w3.org/css-validator/ 4 Rules • The project is designed to be solved independently. • You may not share submitted code with anyone. You may discuss the assignment requirements or your solutions away from a computer and without sharing code, but you should not discuss the detailed nature of your solution. If you develop any tests for this assignment, you may share your test code with anyone in the class. Please do not put any code from this project in a public repository. • You may not use external JavaScript libraries such as JQuery. • You are not to rely on any external functionality to validate your data (I am aware that libraries exist). I want all students to write the necessary validation code themselves. Students who rely on libraries or HTML5 validation to complete the tasks will not receive credit for writing the validation functions. However, it is okay to write regular expressions to validate your data. • Ensure that your archive can be unzipped following the specification shown in the OurVLE submission slot for this assignment. What to turn in 1. You will hand in all of your XHTML, CSS, JavaScript, and PHP files. All of your CSS files must appear in a directory called ‘styles’, your JavaScript and PHP files in a directory called ‘scripts’. 2. A separate (typed) document of a page or so, describing the overall program design for Problem 3, a verbal description of “how it works,” and design tradeoffs considered and made. Also describe possible improvements and extensions to your program (and sketch how they might be made). 3. A separate description of the tests you ran on your program to convince yourself that it is indeed correct. Also describe any cases for which your program is known not to work correctly. Grading • XHTML and CSS files for Problem 1. o Page displays correctly as specified in assignment sheet – 7 points o Pass validation – 3 points • XHTML, CSS and JavaScript files for Problem 2. o Form displays correctly as specified in assignment sheet – 5 points o Validation function works as specified on assignment sheet – 7 points o Passes validation – 3 points • Program listing for Problem 3 o Works correctly as specified in assignment sheet – 20 points o Contains relevant in-line documentation – 3 points o Elegant code, i.e., proper decomposition of functionality – 2 points • Design document o Description – 5 points o Thoroughness of test cases – 5 points
Answered Same DayNov 20, 2021

Answer To: 1 Web Programming Assigned: Nov. 20, 2020 Due: Nov. 27, 2020 @2355 Version: 0.1.0 Problem 1 (10...

Ayush answered on Nov 25 2021
153 Votes
studentid-0x0aa014/Student_ID/p1.html



        Constituency        St. Andrew Eastern
        Polling Div.        61
        Polling Stn        61A
        Location        Papine High School
        Candid
ate1        11
        Candidate2        68
        Rejected        1
        Total        80
        Constituency        St. Andrew Eastern
        Polling Div.        61
        Polling Stn        61B
        Location        Papine High School
        Candidate1        25
        Candidate2        53
        Rejected        1
        Total        79
        Constituency        St. Andrew Eastern
        Polling Div.        74
        Polling Stn        74
        Location        United theological College
        Candidate1        32
        Candidate2        31
        Rejected        1
        Total        64
        Constituency        St. Andrew Eastern
        Polling Div.        76
        Polling Stn        76
        Location        United theological College
        Candidate1        130
        Candidate2        33
        Rejected        4
        Total        167
        Constituency        St. Andrew Eastern
        Polling Div.        77
        Polling Stn        77
        Location        Students' Union
        Candidate1        16
        Candidate2        19
        Rejected        2
        Total        37
studentid-0x0aa014/Student_ID/p2.html
        Constituency        Polling Div.        Polling Stn        Location        Candidate1        Candidate2        Rejected        Total
        St. Andrew Eastern        61        61A        Papine High School        11        68        1        80
        St. Andrew Eastern        61        61B        Papine High School        25        53        1        79
        St. Andrew Eastern        74        74        United Theological College        32        31        1        64
        St. Andrew Eastern        76        76        United Theological College        130        33        4        167
        St. Andrew Eastern        77        77        Students' Union        16        19        2        37
        Total
                                214
        204
        9
        427

studentid-0x0aa014/Student_ID/p3.html



Clerk Id :

Constituency Id :

Polling Division Id :

Polling Station :


...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here