C/C++

10 Item(s)

per page

Grid  List 

Set Descending Direction
  1. CS 372 Throttle Class

    CS 372 Throttle Class

    Regular Price: $20.00

    Special Price: $15.00

    CS 372 Throttle Class


    The simple throttle that we have in mind is a lever that can be moved to control fuel flow. The throttle we have in mind has a single shutoff point (where there is no fuel flow) and a sequence of six on positions where fuel is flowing at progressively higher rates. At the topmost position, the fuel flow is fully on.lever. For example, with six possible positions, and the lever in the fourth position, the fuel flows at 4/6 of its maximum rate.
    One function provided with the class permits a program to initialize a throttle to its shutoff position. Once the throttle has been initialized, there is another function to shift the throttle lever by a given amount.
    We also have two functions to examine the status of a throttle. The first of these functions returns the amount of fuel currently flowing, expressed as a proportion of the maximum flow. For example, this function will return approximately 0.667 when the six-position throttle is in its fourth position. The other function returns a true-or-false value, telling whether the throttle is currently on (that is, whether the lever is above the zero position).


    The throttle must have four positions:
    1. A function to set a throttle to its shutoff position.
    2. A function to shift a throttle’s position by a given amount.
    3. A function that returns the fuel flow, expressed as a proportion of the maximum flow.
    4. A function to tell us whether the throttle is currently on.

    Learn More
  2. 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
  3. Warehouse App Management System C Program Output

    Warehouse App Management System C Program

    Regular Price: $50.00

    Special Price: $40.00

    Warehouse App Management System C Program


    Part A Introduction
    Your friend owns a frozen food warehouse which keeps wholesale food items in a gigantic freezer at -24C. Orders arrive daily from supermarkets and restaurants by email and are “picked” and placed on pallets before being shipped to the customer.
    Your friend explains that the company is using off the shelf software to successfully manage the delivery side of the business. He explains that he needs a way to monitor and communicate the pallet picking jobs to the employees.


    He is interested in having an app developed so that he can assign, manage and monitor the progress of the picking operations. His employees with smart phones will see what pallets (orders) are assigned to them and then update them when completed.


    As a first step, he wishes to analyse data regarding pallet picking jobs and employee information to see how efficiently his company is performing. You are required to implement (using the C programming language) a prototype management system for the frozen food store. Make use of techniques covered in the course material: functions, file handling, dynamic memory allocation, data structures and sorting algorithms.


    The Warehouse App Management System (WAMS) will have 2 important files: one file to record information about the employees and another file to record information about the pallets picked by the employees. The picker’s name and number are kept on file. Each pallet (job) will have an employee’s number, job number, customer name, date (and time) due and a date (and time) completed on file. You can use a dummy date and time for the date and time completed information. An employee can have many picking jobs assigned to him.


    WAMS should provide functions to add employees and jobs, view employee information, sort employee information by name, view job information by date, sort job information by location, and view job information by employee.


    Create a C program to implement the functions described below. Note that you may add your own utility-style functions in addition to each of the functions required. Note also that the program should be contained in one file only (i.e. no header files or multiple source files). Document your code by including comments throughout, for example, document functions with header comments. (Comments contained just before the function definition.) Your system should include a user manual containing instructions on how to run the WAMS as well as pseudo code or flowcharts for each function.
    [70 marks]


    Function 1: display_menu
    When the application is started, use this function to print a list of options to the user using a numbered list. When the user selects an option, the system performs the required action, and returns to the menu waiting for the user to select another option. Include an option to exit the system.


    Your main menu system might resemble the following:
    1. Add an Employee
    2. Add a job
    3. View all employee information
    4. Sort employee information by name
    5. View job information by date and time due
    6. Sort job information by customer
    7. Sort job information by date and time due
    8. Set job as completed
    9. View job information by employee
    10. Exit


    Function 2: load_data
    This function is automatically called when the program is started. It reads employee and job information from files. If the files do not exist, notify the user, create the files and display the main menu. Once a file is open, data is read into an array of structs by dynamically creating sufficient memory for each entry read from the file.


    Define a struct to represent the information for an employee, containing the following fields:
    • Number (int)
    • Employee (char[])


    Define a struct to represent the information for a job, containing the following fields:


    • Employee number (int)
    • Job Number (int)
    • Customer (char([])
    • Due date/time (appropriate object)
    • Completed Time (appropriate object)


    Function 3: add_new_employee
    When the user selects the “add new employee” menu item, prompt them for the data for the new employee. Append the new employee to the array of current employees and notify the user that the new record has been added successfully.


    Function 4: add_new_job
    When the user selects the “add new job” menu item, prompt them for the new job information. Append the new job to the array of current jobs and notify the user that the new record has been added successfully.


    Function 5: view_employee
    When the user selects the “view employees” option, this function prints a list of all employee information on record. Make sure that the employee information is in a report with headers, not simply a list of raw information.


    Function 6: sort_employee
    Give the user the option to sort employees by name. Store the sorted information and notify the user of the name of the file. This function displays the employee, number, sorted by employee. Make a copy of the original array of employees to perform the sorting function. Make sure that the employee information is in a report with headers, not simply a list of raw information.


    Function 7: view_job_information_time_due
    When the user selects the “View job information by date and time due” menu option, this function prompts the user for a job number. It then displays the date/time (in a human-readable format), the employee number, the customer and the time completed. Make sure that the information is in a report with headers, not simply a list of raw information.


    Function 8: sort_job_information_by_customer
    When the user selects the “sort job information by customer” menu options, this function display all jobs sorted by customer. Store the sorted information and notify the user of the name of the file. Make a copy of the original array of jobs to perform the sorting function. Make sure that the job information is in a report with headers, not simply a list of raw information.


    Function 9: set_job_completed
    When the user selects the “Set job as completed” menu options, prompt them for the job number. Then find the corresponding job and set the date and time completed variable to the current date and time. Store the updated information and notify the user of the name of the file.


    Function 10: view_job_information_by_employee
    When the user selects the “view job information by employee” menu option, this function displays each employee and the job number of the jobs that they have in the database. Make sure that the information is in a report with headers, not simply a list of raw information.


    Function 11: save_data
    This function is called when the user chooses to exit the system. Open all data files and write out the information contained in the respective arrays.


    Part B - Modification
    What other set of requirements could be implemented as part of WAMS to improve its functionality toward a real-time app? Choose one requirement (e.g. Print a list of recently completed jobs or print the most urgent unfinished job.), provide a definition, flowchart or pseudo code, and a suitable implementation to be included as part of the overall system. Amend the employee and/or job structures accordingly, to handle any extra information.
    [30 marks]

    Learn More
  4. Word ending with ED

    Finding words ending with ed C Program

    Regular Price: $12.00

    Special Price: $10.00

    Finding words ending with ed C Program


    You are required to complete the following programming exercise:
    Write a program that reads in a file containing several lines of text and then prints only those strings that end with the letters “ed”.


    The program should do the following:
    Prompt the user for the name of a text file (if the file does not exist, display an error message and re-prompt)
    Read in a series of strings from the text file and store these in an array of strings, dynamically allocating memory for each element
    Loop through the populated string array and find elements that end with the characters "ed"
    Display on screen a list of only those strings that end with "ed"

    Learn More
  5. Bubble Sort Algorithm

    Bubble Sort Algorithm C Program

    Regular Price: $12.00

    Special Price: $10.00

    Bubble Sort Algorithm C Program


    You are required to complete the following programming exercise:
    Write a program, called sort_file, which takes a text file as input and produces an output file which has all the original lines in alphabetical order.


    The program should do the following:
    Prompt the user for the names of the input and output files. You can prepare an input file with appropriate unsorted data. A simple file with one word per line will suffice.


    Declare and define three functions to perform the following tasks:
    Read the data from the input file into an array.
    Sort the array using the bubble sort algorithm.
    Write the sorted data array to the output file.

    Learn More
  6. Towers of Hanoi C Program

    Towers of Hanoi C Program

    Regular Price: $15.00

    Special Price: $12.00

    Towers of Hanoi C Program


    Every budding computer scientist must grapple with certain classic problems, and the Towers of Hanoi is one of the most famous of these. Legend has it that in a temple in the Far East, priests are attempting to move a stack of disks from one peg to another.


    The initial stack had 64 disks threaded onto one peg and arranged from bottom to top by decreasing size. The priests are attempting to move the stack from this peg to a second peg under the constraints that exactly one disk is moved at a time, and at no time may a larger disk be placed above a smaller disk. A third peg is available for temporarily holding the disks. Supposedly the world will end when the priests complete their task, so there is little incentive for us to facilitate their efforts.


    Illustration of Towers of Hanoi
    Let us assume that the priests are attempting to move the disks from peg 1 to peg 3. We wish to develop an algorithm that will print the precise sequence of disk-to-disk peg transfers.


    If we were to approach this problem with conventional methods, we would rapidly find ourselves hopelessly knotted up in managing the disks. Instead, if we attack the problem with recursion in mind, it immediately becomes tractable. Moving n disks can be viewed in terms of moving only n – 1 disks (and hence the recursion) as follows:


    Move n – 1 disks from peg 1 to peg 2, using peg 3 as a temporary holding area.
    Move the last disk (the largest) from peg 1 to peg 3.
    Move the n – 1 disks from peg 2 to peg 3, using peg 1 as a temporary holding area.
    The process ends when the last task involves moving n = 1 disk, i.e., the base case. This is accomplished by trivially moving the disk without the need for a temporary holding area.


    Write a program to solve the Towers of Hanoi problem. Use a recursive function with four parameters:


    The number of disks to be moved
    The peg on which these disks are initially threaded
    The peg to which this stack of disks is to be moved
    The peg to be used as a temporary holding area
    Your program should print the precise instructions it will take to move the disks from the starting peg to the destination peg.
    For example, to move a stack of three disks from peg 1 to peg 3, your program should print the following series of moves:


    1 → 3 (This means move one disk from peg 1 to peg 3.)
    1 → 2
    3 → 2
    1 → 3
    2 → 1
    2 → 3
    1 → 3

    Learn More
  7. Fortune Cookie C program

    Fortune Cookie C program

    Regular Price: $10.00

    Special Price: $8.00

    Fortune Cookie C program


    Build a Fortune Cookie program that uses either the Chinese Zodiac or astrological signs to generate a fortune, a prediction, or a horoscope based on the user input. More specifically, the user may need to input her year of birth, month of birth, and day of birth depending on zodiac or astrological techniques used. With this information, generate a custom message or fortune. You can use the Internet to find more information on the Chinese Zodiac or astrology.

    Learn More
  8. INF 231 Week 5 Assignment Final Project Dollars to Coins CPP

    INF 231 Week 5 Assignment Final Project Dollars to Coins CPP

    Regular Price: $12.00

    Special Price: $10.00

    INF 231 Week 5 Assignment Final Project Dollars to Coins CPP


    The Final Project consists of building an executable monetary conversion program to be submitted by the final day of the course.


    Focus of the Project For the program, you will write a utility that converts dollars to coins.
    It is a simple program that must have the following:
    • Multiple outputs to the screen
    • At least one input
    • The use of integers and strings
    • Looking or repetition with Do..While, If..Else
    • Must have some output text to show correct value of coins that would be converted from the dollars.
    • Code must include comments explaining your reason for the code section or what the code is doing
    • Code must compile
    • Whole dollars only. If value is less than 1 or 0, the program should break or exit.


    Turn in your source code (.cpp file) to your instructor with your filename including your first and last name and your compiled executable.

    Learn More
  9. CS 372 Throttle Class Overload

    CS 372 Throttle Class Overload

    Regular Price: $20.00

    Special Price: $15.00

    CS 372 Throttle Class Overload


    Create the "throttle" class as shown in the text with
    a. data members of "position" and "Top_Position" (maximum throttle position)


    b. Default "constructor" with two arguments The first sets the "Top_position" and the second sets the current "position". The third is a copy constructor Ex declaration:
    throttle car - set Top_Position to 6 and current to 0
    throttle truck(30) - sets Top_position to 30 and current position to 0
    throttle shuttle(20,6) - sets Top_position to 20 and current position to 6
    throttle mythrottle(truck) -sets/initilizes obj mythrottle to the same values of obj truck


    c. Add a member function that will "compare" two throttles using the '==' symbol.
    ex if ( car = truck ) ... Implement the '==' member function inside the class throttle.
    i. To test the above, write code to call the '==' function explicitly ie operator==.
    ii. Also code to call the above function using the nice syntax '=='.


    d. Add the member function '!=' to throttle and implement this function outside the class.
    i. To test the above, write code to call the '!=' function explicitly ie operator!=.
    ii. Also code to call the above function using the nice syntax '!='.


    e. Write an overloaded output function (<<) to print out an object throttle showing the Top_position and the current position.


    f. Write a main program that will test the above implementation of throttle that will convince me your throttle class is correct. (ie all methods work.)

    Learn More
  10. 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

10 Item(s)

per page

Grid  List 

Set Descending Direction