Description
Create a Movies class that determines the cost of a ticket to a cinema,
based on the moviegoer’s age. Assume that the cost of a full-price ticket is $10. Assign the age to a private data member. Use a public member function to determine the ticket price, based on the follow- ing schedule: Age Price Under 5 Free 5 to 17 Half price 18 to 55 Full price Over 55 $2 off
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Review
Review
Anonymous
Nice! Really impressed with the quality.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
Performing an Advanced MySQL Query
Using the world_x database you installed in Module 1, list the countries and the capitals of each country. Modify your que ...
Performing an Advanced MySQL Query
Using the world_x database you installed in Module 1, list the countries and the capitals of each country. Modify your query to limit the list to those countries where less than 30% of the population speaks English. Be sure to identify the literary sources you used to look up any SQL syntax you used to formulate your query.Submit your query and query results Word file.
Harrisburg Area Community College C program using POSIX Shared Memory Lab Report
Shared memory is considered to be the fastest IPC mechanisms since there is no copying between different processes' memory ...
Harrisburg Area Community College C program using POSIX Shared Memory Lab Report
Shared memory is considered to be the fastest IPC mechanisms since there is no copying between different processes' memory locations, the information needs to be written into the shared memory location once. The other option is to copy different memory locations from the sourcing process to the receiving process.POSIX shared memory is based on the UNIX philosophy, all Input and Output operations have to be done on an object file. POSIX shared memory uses a memory-mapped file that associates a memory region with a file, hence read and write operations are treated as a reading and writing to a file using a file descriptor.To use shared memory operations, you need first to define and create a shared memory object. To do so we use the “ shm_open” system call: int shm_open (const char *name, int oflag, mode_t mode);const char * name : The first parameter specifies the name of the shared memory object. This is the name processes you will use to access this shared memory.int Oflag : specifies a bit mask constructed using OR logical operations to descript the different flags and options associated with this shared memory object. For example, O_CREAT to create the shared memory object if it does not exist, O_RDWR for the read and write permissions.mode_t mode : The third parameter used to describe the mode, which indicates the file permissions of the shared object similar to Linux file permissions wherethe first number represents the Owner permission; the second represents the Group permissions; and the last number represents the permissions for all other users. The numbers are a binary representation of the rwx string:r = 4w = 2x = 1For example, to set permissions to read rwxr_____, you would enter 740. A successful call to shm_open returns an integer that represents a file descriptor for the shared memory object. The object is created with a size equal to zero. The system call requires the following headers:#include <sys/mman.h>#include <sys/stat.h>#include <fcntl.h>The next step is to decide the size of the object established, for this operation we use the function ftruncate :int ftruncate (int fd, off_t length);int fd: The function takes a file descriptor fd as a first parameteroff_t length: changes the file size to length bytes.ftruncate returns zero on success and -1 in case of error or failure to increase size.To use the function, you need to include the following headers: #include <unistd.h>#include <sys/types.h> The final step before using the shared memory object is to connect the process’s memory address space to the file descriptor such that you can access the file using regular memory addresses. This memory address is mapped into the process's virtual memory. To do complete the connection, we use the mmap function. void* mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);void * addr : specifies the address at which it should be mapped. In most cases, we do not care at what address mapping is done and a value of NULL for addr should suffice.size_t length: is the length of the shared memory object that should be mapped. To keep things simple, we will map the whole object, and the length for us will be the length of the shared memory object.int prot: can have the values, PROT_EXEC, PROT_READ, PROT_WRITE, PROT_NONE, and MAP_SHARED.PROT_READ | PROT_WRITE value, Which means we can read and write into the shared memory.MAP_SHARED, which means that the updates to the mapped shared memory are visible to all other processes immediately.int fd : the file descriptor for the shared memory received from an earlier shm_openoff_t offset: is the location in the shared memory object at which the mapping starts; we will use the value zero for offset and map the shared memory object starting from the beginning.mmap returns a pointer to the memory-mapped file that is used for accessing the shared memory object or -1 in case of failure or error. mmap requires the following headers to be included in your code:#include <sys/mman.h> When the shared memory object is no longer needed, the function shm_unlink() is used to remove the object from the memory.int shm_unlink (const char *name);const char * name : the name of the shared memory object as described under shm_open function above.shm_unlink uses the same headers as the shm_open function.The producer creates a shared memory object named SHARED and writes a string “Hello World!” into the shared memory object. You will need to use sprintf() function and a pointer ptr to write and format strings into the shared memory location. The pointer ptr will increment to point to the next available empty space in the shared memory buffer.The consumer process reads and outputs the content of the shared memory. The consumer access the shared memory using the same name as the producer. The consumer follows the same steps as producer except that it uses printf function to print the content of the memory location pointed by ptr, which should be the same as the information provided in the producer code. One major difference here is the usage of shm_unlink function which removes the shared memory object.Notice:When compiling codes that use the POSIX shared memory library, you will need to add the following option to your GCC command line: -lrt. This will add the POSIX RealTime extension library to your code. Your command line should look something like :gcc program_with_POSIX_SHM.c -o output -lrtLab Instructions:Write the following two C programs with the following specifications:Code should be thoroughly commented Write two C programs, producer, and consumer programs that communicate using a POSIX shared memory.Producer CodeThe producer program will accept input from the user and write that input into a shared memory location. The program will create and write to a POSIX shared memory. The program will terminate when the user enters “End” as an input.Initial conditions and values:The shared memory location name is “ SHARED “.FunctionalityAccept input from user, write the user string into the shared memory location.The program terminates when the user enters “End”.Consumer CodeWrite a C program that will open a POSIX shared memory; the program will read and print the contents of the shared memory and closes the shared memory object afterward.Initial conditions and values:The shared memory location name is “ SHARED “.FunctionalityPrint the content of the shared memory location.Exit the program when all memory contents are displayed.Sample output is shown in the program
6 pages
Introduction To Information Technology And Information Systems.edited
1. For IT to be successful in business, the organization must plan how to use information technology. There are two differ ...
Introduction To Information Technology And Information Systems.edited
1. For IT to be successful in business, the organization must plan how to use information technology. There are two different methodologies used for ...
CS421 Western Governors American Video Game Company Software Solution Project
SCENARIOYou are a member of a software development team for a project, which includes business analysts, solution analysts ...
CS421 Western Governors American Video Game Company Software Solution Project
SCENARIOYou are a member of a software development team for a project, which includes business analysts, solution analysts, developers, quality assurance professionals, and a project manager, among other team members. You have been tasked with completing a solution proposal and design and test plan with the help of your team to support the software development process. The American Video Game Company has provided a high-level requirements document to aid you in identifying an appropriate solution.The project is to implement a customer relationship management (CRM) system for the sales force of a medium-sized company. The initial requirements document has been provided for you to use in determining a solution. You may choose to implement a customizable/commercial off-the-shelf (COTS) system, or you may decide to have the system custom built. When making this decision, ensure all requirements are considered and can be implemented if choosing a COTS system. If you decide to build the system, consider the additional resources that will be needed. Review the attached “CRM Requirements” document provided with the assessment to gain an overall understanding of the system the American Video Game Company is looking for.REQUIREMENTSYour submission must be your original work. No more than a combined total of 30% of the submission and no more than a 10% match to any one individual source can be directly quoted or closely paraphrased from sources, even if cited correctly. An originality report is provided when you submit your task that can be used as a guide.You must use the rubric to direct the creation of your submission because it provides detailed criteria that will be used to evaluate your work. Each requirement below may be evaluated by more than one rubric aspect. The rubric aspect titles may contain hyperlinks to relevant portions of the course.Review the attached “CRM Requirements” to gain an overall understanding of the system that American Video Game Company is looking for. Then propose a software solution for American Video Game Company by doing the following:A. Introduce your proposed system, including a purpose statement, overview of the problem, goals and objectives for the project and solution, prerequisites, scope, and environment, as outlined in the attached “Design Template.” Note: The Introduction section of this report may be done after the project task is completed.B. Explain how your software solution addresses five distinct requirements from the attached “CRM Requirements.” C. Discuss the waterfall method by doing the following:1. Compare the advantages and disadvantages of the waterfall method to those of another development method of your choice.2. Evaluate whether the waterfall method or the development method you chose in C1 is better suited to the solution for American Video Game Company, including specific examples to justify your claims.D. Create two visual representations of your software solution (e.g., storyboard, flowchart, UML diagram, ERD) that illustrate how the system process or workflow aligns with and supports the business process for American Video Game Company. E. Create a test plan with test cases for three different functional aspects of your software solution, including the following:• preconditions for each test case• steps for each test case• expected results for each test case F. Acknowledge sources, using in-text citations and references, for content that is quoted, paraphrased, or summarized. G. Demonstrate professional communication in the content and presentation of your submission.
University of Maryland Global Adeoye Gym Fitness Tracking System Project
Q8. Show which city has the most students. Display city and state, and number of students. Q10: List all cities that have ...
University of Maryland Global Adeoye Gym Fitness Tracking System Project
Q8. Show which city has the most students. Display city and state, and number of students. Q10: List all cities that have 10 or more students and instructor combined. Show city, state, number of
student residents, number of instructor residents, and total student/instructor residents in that city. Sort
by total in descending order. I would upload the student schema file that's used with this assignment
Great a script and set up Apache HTTP server, programming homework help
Create a script that backs up the MySQL database every 3 hours Set
up Apache HTTP server, with PHP and MySQL. Run Joomla ...
Great a script and set up Apache HTTP server, programming homework help
Create a script that backs up the MySQL database every 3 hours Set
up Apache HTTP server, with PHP and MySQL. Run Joomla on top of these
technologies (Do not use an
all-in-one solution such as LAMP). The instructors are down below.
Similar Content
simple c++ homework
...
MATLAB question
MATLAB question in one all-inclusive script and submit online . In order to receive points, your script will have to run w...
Global University Python Programming Worksheet
Question1:Write a Python program to convert temperature fromCelsius to Fahrenheit and Kelvins; from Fahrenheit toCelsius a...
VT Programming Class Diagram for The Food Truck System Question
creating UML class diagram for the Food Truck System...
discuss and write , programming homework help
Design a guide of the types of email and social media would be best for you neighbor. Explain the role of each and why cho...
check the pdf file
Page |1
Programming Fundamentals II
Java Assignment 1
In this assignment you are going to implement the same game we deve...
Seo And Website Design Final Report
Redesign and building a user-friendly website is always the number one goal for every company that wants to gain a massive...
P4solutiondescription
No record in Outdata.txt file when program is initialized Use of JRadioButton, JButton, JLabel, JTextField, GridLayout, an...
Cpp2
2. An apartment complex contains possibly 60 apartments, rented out at possibly $500, when the apartment is at this rent p...
Related Tags
Book Guides
The Jade Peony
by Wayson Choy
Killers of the Flower Moon
by David Grann
The Lost Man
by Jane Harper
Ezperanza Rising
by Pam Muñoz Ryan
Slaughterhouse Five
by Kurt Vonnegut
The Russian Hoax
by Gregg Jarrett
The House of the Seven Gables
by Nathaniel Hawthorne
Freakonomics
by Stephen J. Dubner and Steven D. Levitt
What Happened
by Hillary Clinton
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
Performing an Advanced MySQL Query
Using the world_x database you installed in Module 1, list the countries and the capitals of each country. Modify your que ...
Performing an Advanced MySQL Query
Using the world_x database you installed in Module 1, list the countries and the capitals of each country. Modify your query to limit the list to those countries where less than 30% of the population speaks English. Be sure to identify the literary sources you used to look up any SQL syntax you used to formulate your query.Submit your query and query results Word file.
Harrisburg Area Community College C program using POSIX Shared Memory Lab Report
Shared memory is considered to be the fastest IPC mechanisms since there is no copying between different processes' memory ...
Harrisburg Area Community College C program using POSIX Shared Memory Lab Report
Shared memory is considered to be the fastest IPC mechanisms since there is no copying between different processes' memory locations, the information needs to be written into the shared memory location once. The other option is to copy different memory locations from the sourcing process to the receiving process.POSIX shared memory is based on the UNIX philosophy, all Input and Output operations have to be done on an object file. POSIX shared memory uses a memory-mapped file that associates a memory region with a file, hence read and write operations are treated as a reading and writing to a file using a file descriptor.To use shared memory operations, you need first to define and create a shared memory object. To do so we use the “ shm_open” system call: int shm_open (const char *name, int oflag, mode_t mode);const char * name : The first parameter specifies the name of the shared memory object. This is the name processes you will use to access this shared memory.int Oflag : specifies a bit mask constructed using OR logical operations to descript the different flags and options associated with this shared memory object. For example, O_CREAT to create the shared memory object if it does not exist, O_RDWR for the read and write permissions.mode_t mode : The third parameter used to describe the mode, which indicates the file permissions of the shared object similar to Linux file permissions wherethe first number represents the Owner permission; the second represents the Group permissions; and the last number represents the permissions for all other users. The numbers are a binary representation of the rwx string:r = 4w = 2x = 1For example, to set permissions to read rwxr_____, you would enter 740. A successful call to shm_open returns an integer that represents a file descriptor for the shared memory object. The object is created with a size equal to zero. The system call requires the following headers:#include <sys/mman.h>#include <sys/stat.h>#include <fcntl.h>The next step is to decide the size of the object established, for this operation we use the function ftruncate :int ftruncate (int fd, off_t length);int fd: The function takes a file descriptor fd as a first parameteroff_t length: changes the file size to length bytes.ftruncate returns zero on success and -1 in case of error or failure to increase size.To use the function, you need to include the following headers: #include <unistd.h>#include <sys/types.h> The final step before using the shared memory object is to connect the process’s memory address space to the file descriptor such that you can access the file using regular memory addresses. This memory address is mapped into the process's virtual memory. To do complete the connection, we use the mmap function. void* mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);void * addr : specifies the address at which it should be mapped. In most cases, we do not care at what address mapping is done and a value of NULL for addr should suffice.size_t length: is the length of the shared memory object that should be mapped. To keep things simple, we will map the whole object, and the length for us will be the length of the shared memory object.int prot: can have the values, PROT_EXEC, PROT_READ, PROT_WRITE, PROT_NONE, and MAP_SHARED.PROT_READ | PROT_WRITE value, Which means we can read and write into the shared memory.MAP_SHARED, which means that the updates to the mapped shared memory are visible to all other processes immediately.int fd : the file descriptor for the shared memory received from an earlier shm_openoff_t offset: is the location in the shared memory object at which the mapping starts; we will use the value zero for offset and map the shared memory object starting from the beginning.mmap returns a pointer to the memory-mapped file that is used for accessing the shared memory object or -1 in case of failure or error. mmap requires the following headers to be included in your code:#include <sys/mman.h> When the shared memory object is no longer needed, the function shm_unlink() is used to remove the object from the memory.int shm_unlink (const char *name);const char * name : the name of the shared memory object as described under shm_open function above.shm_unlink uses the same headers as the shm_open function.The producer creates a shared memory object named SHARED and writes a string “Hello World!” into the shared memory object. You will need to use sprintf() function and a pointer ptr to write and format strings into the shared memory location. The pointer ptr will increment to point to the next available empty space in the shared memory buffer.The consumer process reads and outputs the content of the shared memory. The consumer access the shared memory using the same name as the producer. The consumer follows the same steps as producer except that it uses printf function to print the content of the memory location pointed by ptr, which should be the same as the information provided in the producer code. One major difference here is the usage of shm_unlink function which removes the shared memory object.Notice:When compiling codes that use the POSIX shared memory library, you will need to add the following option to your GCC command line: -lrt. This will add the POSIX RealTime extension library to your code. Your command line should look something like :gcc program_with_POSIX_SHM.c -o output -lrtLab Instructions:Write the following two C programs with the following specifications:Code should be thoroughly commented Write two C programs, producer, and consumer programs that communicate using a POSIX shared memory.Producer CodeThe producer program will accept input from the user and write that input into a shared memory location. The program will create and write to a POSIX shared memory. The program will terminate when the user enters “End” as an input.Initial conditions and values:The shared memory location name is “ SHARED “.FunctionalityAccept input from user, write the user string into the shared memory location.The program terminates when the user enters “End”.Consumer CodeWrite a C program that will open a POSIX shared memory; the program will read and print the contents of the shared memory and closes the shared memory object afterward.Initial conditions and values:The shared memory location name is “ SHARED “.FunctionalityPrint the content of the shared memory location.Exit the program when all memory contents are displayed.Sample output is shown in the program
6 pages
Introduction To Information Technology And Information Systems.edited
1. For IT to be successful in business, the organization must plan how to use information technology. There are two differ ...
Introduction To Information Technology And Information Systems.edited
1. For IT to be successful in business, the organization must plan how to use information technology. There are two different methodologies used for ...
CS421 Western Governors American Video Game Company Software Solution Project
SCENARIOYou are a member of a software development team for a project, which includes business analysts, solution analysts ...
CS421 Western Governors American Video Game Company Software Solution Project
SCENARIOYou are a member of a software development team for a project, which includes business analysts, solution analysts, developers, quality assurance professionals, and a project manager, among other team members. You have been tasked with completing a solution proposal and design and test plan with the help of your team to support the software development process. The American Video Game Company has provided a high-level requirements document to aid you in identifying an appropriate solution.The project is to implement a customer relationship management (CRM) system for the sales force of a medium-sized company. The initial requirements document has been provided for you to use in determining a solution. You may choose to implement a customizable/commercial off-the-shelf (COTS) system, or you may decide to have the system custom built. When making this decision, ensure all requirements are considered and can be implemented if choosing a COTS system. If you decide to build the system, consider the additional resources that will be needed. Review the attached “CRM Requirements” document provided with the assessment to gain an overall understanding of the system the American Video Game Company is looking for.REQUIREMENTSYour submission must be your original work. No more than a combined total of 30% of the submission and no more than a 10% match to any one individual source can be directly quoted or closely paraphrased from sources, even if cited correctly. An originality report is provided when you submit your task that can be used as a guide.You must use the rubric to direct the creation of your submission because it provides detailed criteria that will be used to evaluate your work. Each requirement below may be evaluated by more than one rubric aspect. The rubric aspect titles may contain hyperlinks to relevant portions of the course.Review the attached “CRM Requirements” to gain an overall understanding of the system that American Video Game Company is looking for. Then propose a software solution for American Video Game Company by doing the following:A. Introduce your proposed system, including a purpose statement, overview of the problem, goals and objectives for the project and solution, prerequisites, scope, and environment, as outlined in the attached “Design Template.” Note: The Introduction section of this report may be done after the project task is completed.B. Explain how your software solution addresses five distinct requirements from the attached “CRM Requirements.” C. Discuss the waterfall method by doing the following:1. Compare the advantages and disadvantages of the waterfall method to those of another development method of your choice.2. Evaluate whether the waterfall method or the development method you chose in C1 is better suited to the solution for American Video Game Company, including specific examples to justify your claims.D. Create two visual representations of your software solution (e.g., storyboard, flowchart, UML diagram, ERD) that illustrate how the system process or workflow aligns with and supports the business process for American Video Game Company. E. Create a test plan with test cases for three different functional aspects of your software solution, including the following:• preconditions for each test case• steps for each test case• expected results for each test case F. Acknowledge sources, using in-text citations and references, for content that is quoted, paraphrased, or summarized. G. Demonstrate professional communication in the content and presentation of your submission.
University of Maryland Global Adeoye Gym Fitness Tracking System Project
Q8. Show which city has the most students. Display city and state, and number of students. Q10: List all cities that have ...
University of Maryland Global Adeoye Gym Fitness Tracking System Project
Q8. Show which city has the most students. Display city and state, and number of students. Q10: List all cities that have 10 or more students and instructor combined. Show city, state, number of
student residents, number of instructor residents, and total student/instructor residents in that city. Sort
by total in descending order. I would upload the student schema file that's used with this assignment
Great a script and set up Apache HTTP server, programming homework help
Create a script that backs up the MySQL database every 3 hours Set
up Apache HTTP server, with PHP and MySQL. Run Joomla ...
Great a script and set up Apache HTTP server, programming homework help
Create a script that backs up the MySQL database every 3 hours Set
up Apache HTTP server, with PHP and MySQL. Run Joomla on top of these
technologies (Do not use an
all-in-one solution such as LAMP). The instructors are down below.
Earn money selling
your Study Documents