Free

Writing a program to see if a child is 18 years of age - Coursework Example

Comments (0) Cite this document
Summary
The coding process uses hypertext markup language (html), and PHP programming languages. Display functions of “Choose your Date of Birth” and…
Download full paperFile format: .doc, available for editing
GRAB THE BEST PAPER95.5% of users find it useful
Writing a program to see if a child is 18 years of age
Read TextPreview

Extract of sample "Writing a program to see if a child is 18 years of age"

A Program to Control Minors from Accessing an Online Store PSEUDO START DISPLAY s GET Customers name
DISPLAY
“Choose your Date of Birth”
GET
Date of birth
DISPLAY
“confirm your liability”
age difference = current date – date of birth
If age difference > 18
DISPLAY “you are Welcome, Click on the link bellow to proceed.”
else
if age difference < 18
DISPLAY “We are sorry you cannot shop here.”
END
Pseudo-code Explanation
This code explains the age authentication process in an e-commerce web site that deny children bellow the age of 18 to shop from it. The coding process uses hypertext markup language (html), and PHP programming languages. Display functions of “Choose your Date of Birth” and “confirm your liability” are implemented using HTML and CSS style sheets to display them to a web page.
The GET function that captures Customers name and Date of Birth uses forms in HTML to allow input of the values and the submit button to post the values to a PHP page to capture the values. The implementation is through the PHP inbuilt methods of POST[] and GET[]. The age format that has been input is verified using an age PHP function:
function age ($birthdate) {
}
The age difference of the user is calculated by comparing the age that has been input by the user and the current day and time that the process is taking place. It is possible by virtue of a PHP inbuilt function:
function (age) {
return floor ($age / $year)
}
This function returns the age difference of the user trying to shop from the website.
If else function determine if the user will proceed. If the user is above 18 years, he will be allowed to proceed by displaying “you are Welcome, Click on the link bellow to proceed” and upon clicking the link will be taking to a page that he can shop. Else if the age difference is bellow 18 years a
“We are sorry you cannot shop here” message will be displayed to them and no link will be provided to them to continue shopping.
FLOW CHART
Problem Analysis Chart
Solution Alternatives
The solutions to this problem are through other methods like:
- verifying the age of the user through the registration process that will only allow registration of users with age of 18 years and above. It reduces the redundancy of verifying the age of the user every time they are making a purchase.
- verifying the age of the user through checking credit card information that also captures the age of credit card holder.
- Getting age information from legal databases like government registration databases
References
Duckett, J. (2008). Beginning Web Programming with HTML, XHTML, and CSS (1st ed.). Hoboken: John Wiley & Sons.
. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Writing a program to see if a child is 18 years of age Coursework”, n.d.)
Writing a program to see if a child is 18 years of age Coursework. Retrieved from https://studentshare.org/logic-programming/1654890-writing-a-program-to-see-if-a-child-is-18-years-of-age
(Writing a Program to See If a Child Is 18 Years of Age Coursework)
Writing a Program to See If a Child Is 18 Years of Age Coursework. https://studentshare.org/logic-programming/1654890-writing-a-program-to-see-if-a-child-is-18-years-of-age.
“Writing a Program to See If a Child Is 18 Years of Age Coursework”, n.d. https://studentshare.org/logic-programming/1654890-writing-a-program-to-see-if-a-child-is-18-years-of-age.
  • Cited: 0 times
Comments (0)
Click to create a comment or rate a document

CHECK THESE SAMPLES OF Writing a program to see if a child is 18 years of age

Writing in the Visual Age

...? 27 June Writing in the visual age: Visual communication also known as visual rhetoric is generally considered to be quite a recent concept identifying how powerfully visual images could add meaning to the communication or deftly lend depth or significance to a certain argument in comparison to aural or verbal messages. While some emphasize the need to essentially teach rhetorical analysis of images to the students of a writing class, others advocate the importance of aural or textual messages by claiming that no matter how skillfully designed, pictures or images should not be considered to be more capable both emotionally and informatively in comparison to words. Those favoring the...
7 Pages(1750 words)Research Paper

The legal drinking age should be 18 years of age

...Drinking age should be reduced to 18 years of Age Outline Thesis ment: However, the legal age for alcohol consumption should be reduced from 21years of age to 18years since the later are responsible young adults entitled to vote, marry; and considering the menace of over-consumption due to curiosity and experimentation. 18 year old are young citizens capable of taking responsibility and making decisions Right to vote, marry Acquisition of identity cards Secure employment The forbidden fruit Menace Over indulgence in alcohol out of curiosity Rebellious nature of young adults of 18...
4 Pages(1000 words)Essay

A Healthy Child

...of separation anxiety appear at about six months of age. Children between the age of 9 and 18 months will usually have a lot of difficulty beginning a child care program. Parents can make the transition easier by bringing the child's favorite toy or blanket along. (Source: Understanding Growth and Development Patterns of Infants by Novella J. Ruffin, June 2001) Movement, Learning And The Brain The human body was designed to move, and it is our early experiences that lay the foundation of what follows. To truly store something mentally as a sensory motor event, some type of movement activity is required - either speaking out loud,...
12 Pages(3000 words)Essay

No Child Left Behind Program

..., according to the Tennessee Department of Education Web site, "Starting with school year 2005-2006, AYP determinations for elementary and middle schools will be based on the results of the math and reading/language arts assessments for grades 3 through 8. So schools must make that adequate yearly progress. This Study will look to see if Cumberland County Schools are making that yearly progress in reading. 1.2 Statement of Problem No Child Left Behind is placing schools on the watch list because of lack of yearly progress. By the year 2014 all children must be reading on grade level. I will take a look to see if schools in Tennessee are making...
42 Pages(10500 words)Coursework

Lower Alcohol age to 18

...The Implications of Lowering Legal Drinking Age to 18: A Comprehensive Analysis Introduction Several state councils lowered the minimum legal drinking age (MLDA) to eighteen in the early 1970s. The idea was that if 18-year-olds were mature enough to take part in an election and to fight and sacrifice their life for the nation, they were mature enough to consume alcohol (7). As time progressed, interest arose over adolescent alcoholism and alcohol-linked road accidents, and, in the 1980s, several states invalidated their previous resolutions by increasing the MLDA to 21. Rising to a proposal of the Presidential Commission on Drunk Driving, Congress...
12 Pages(3000 words)Research Paper

Should the Drinking Age be 18 Years

...Should the Drinking Age be 18 Years? In the recent past, there has been much debate on whether to lower the drinking age from 21 to 18 or not. With adulthood comes the rights, responsibilities and privileges of being one, with the American law describing an adult as that person who is 18 years old or more. This person has the legal authority to enter into contracts, marry without the consent of parents, serve in the military and vote among others, except drinking alcohol. This essay postulates that the drinking age should not be 18. Psychologically, humans would want to do what they have...
1 Pages(250 words)Essay

Creative Writing Program

...College: Creative Writing Program Since its inception on 5th June, 1969, the of Texas at San Antonio (UTSA) hasdeveloped into one of the biggest institutions within the Texas higher education system. UTSA, as can be discerned from its name, is located in the Texas south central city of San Antonio. This state research institution admits more than 40,000 students and has three campuses spanning an area of over 740 acres (UTSA n.pag). These attributes make UTSA the principal university in the city of San Antonio, and warrant it an eighth place ranking in the whole of Texas. UTSA provides a wide range of scholastic studies, with over 130 undergraduate programs, 51 graduate...
2 Pages(500 words)Essay

Experience of having a child at a young age (age-18)

...along and share so much of our life experiences. From time to time, I would think and talk about my future especially where I expected to be in ten years or so. Just like any other typical woman, I would talk about getting into a successful career and starting a family that would remain united forever. Soon after graduating high school, my friendship and relationship with my friends kept growing over time. Some time passed and the story remained the same. Nothing much happened in my life until I discovered I was expecting a child at the age of eighteen. I was happy but worried too that I would have a child at a young age. On one hand, pregnancy was not...
3 Pages(750 words)Essay

Witnessing Television Violence: Child See, Child Do

...Witnessing Television Violence: Child See, Child Do Today, there are many popular television programs that show a great deal of violence against other program characters. In prime time, the level of aggression and bloodshed is very common in many different shows. Even in programs that are created specifically for children, such as Power Rangers and even cartoons, it is a regular event to witness violence. In the cartoon program, Tom and Jerry, a cat runs about in a desperate effort to torment and destroy a mouse. Using hammers, fire and even knives, Tom (the cat) is ever on a manhunt to make sure that Jerry, the mouse, is harmed badly. Violence on television is part of the social norm in programming content. Research has found... that...
3 Pages(750 words)Essay

Virtual Child program

...Virtual Child program Virtual Child program 4 It is a good thing for the child’s temperament to be stable over the first 18 months because it makes it easy to understand its interests. Riley demonstrates all the five aspects of temperament. He is active, sociable, emotional, cooperative, and good in self-control. He is willing to acquire new skills and learn new things. His development skills are in harmony with his age. In terms of activity, he loves crawling and playing. He is quiet sociable, even to visitors. Emotionally, she is usually happy, and only cries when irritated. Riley is cooperative in games such as...
1 Pages(250 words)Essay
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.

Let us find you another Coursework on topic Writing a program to see if a child is 18 years of age for FREE!

Contact Us