COMP 122 complete class - PowerPoint PPT Presentation

About This Presentation
Title:

COMP 122 complete class

Description:

COMP 122 complete class To purchase this material click below link:- For More Tutorials Click Below link:- COMP 122 Lab 4 Lab Report and Source Code COMP 122 Lab 5 Lab Report and Source Code COMP 122 Lab 6 Lab Report and Source Code COMP 122 Lab 7 Lab Report and Source Code COMP 122 Lab 1 Lab Report and Source Code COMP 122 Lab 2 Lab Report and Source Code COMP 122 Lab 3 Lab Report and Source Code – PowerPoint PPT presentation

Number of Views:22
Slides: 10
Provided by: homeworkflip
Category: Other

less

Transcript and Presenter's Notes

Title: COMP 122 complete class


1
COMP 122
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com

2
COMP 122 Lab 7 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    7-lab-report-and-source-code
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • The focus of this lab is on using strings. You
    will have an opportunity to work with both C
    style strings and the string data type. This lab
    also gives you an opportunity to use what you
    have learned previously, including using
    functions, array processing, repetition, and
    selection. You will also have an opportunity to
    work with file input and output.
  • You are to design and implement a program which
    does encryption and decryption of data from
    files. Encryption is the process of taking plain
    lines of text and performing some algorithmic
    transformation on the data to create an encrypted
    line of text which looks nothing like the
    original. Decryption is the process of taking an
    encrypted line of text and performing some
    algorithmic transformation on the data to recover
    the original line of plain text.
  • Encryption and Decryption Approach
  • Our approach to encryption and decryption
    involves two strings. The first is an encryption
    / decryption string which we will allow to be up
    to 128 lower case alphabetical characters in
    length. The second string is a line of text from
    a file that is to be encrypted or decrypted.
  • Our basic strategy for encrypting data is based
    on mapping alphabetical characters to specific
    values, then doing some simple mathematical
    operations to create a new value. First of all,
    every character in either the encryption string
    or the input string is mapped to a number between
    0 and 25 based on its position in the alphabet.
  • 0
  • 1
  • 25

3
COMP 122 Lab 6 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    6-lab-report-and-source-code
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • Week 6 iLab
  • You are to design a program that will allow some
    number of grades (up to a max of 100) to be input
    by the user. After the data has been collected,
    your program should calculate and output the mean
    and median of the collected data, as well as the
    sorted grade information.
  • Design Constraints
  • Use an integer constant of 100 to specify the
    number of elements in the array you will use to
    collect the grade information. Do not use any
    global variables in your program. Declare any
    arrays you need in your main function and pass
    the arrays as needed into the functions described
    below. The main function is the only function
    permitted to do any output to the console!!! Do
    not do cout operations inside of any other
    function. Your data collection loop in your main
    function must allow the user to enter less than
    100 grades. It must also make sure that the user
    does not try to enter more than 100 grades. Each
    data value entered should be checked to make sure
    it is between 0 and 100. Any other value entered
    should be considered invalid and ignored (ie. not
    counted as a valid input and not stored in an
    array). Once the data is collected, the array and
    the number of grades collected must be passed to
    a function called mean. The mean function must
    loop through the values in the array, summing
    them together. The result of the function is the
    sum divided by the number of grades collected.
    The result must be returned from the mean
    function to the main function, where is it output
    in an appropriate manner (two digits after the
    decimal point). The main function should then
    pass the array and the number of grades collected
    to the median function. The median of a set of
    numbers is the number in the set where half the
    numbers are above it and half the numbers are
    below it. In order to find the median, this
    function will need to sort the original .

4
COMP 122 Lab 4 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    4-lab-report-and-source-code
  • or More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • Part 1 of this weeks lab will give you an
    opportunity to use the debugging capabilities of
    Visual Studio. Part 2 will present a problem for
    which you will need to create a test plan and
    actually test an executable program to determine
    if it behaves correctly.
  • Part 1 Using the Debugger
  • To begin this exercise, create a VC project and
    copy the following code into your project. Make
    sure that the project compiles successfully.
  • include
  • using namespace std
  • int main()
  • int input
  • int ,
  • int
  • coutlt"enter"" which"" number"" in"" the""
    fibonacci"" number"" sequence"" you"" want""
    to"" find."""gtltendl""gt
  • coutlt"the"" first"" and"" second""
    fibonacci"" numbers"" are"" 1."""gtltendl""gt
  • cingtgt input
  • while (input lt 1)""gt

5
COMP 122 Lab 3 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    3-lab-report-and-source-code
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • Complete the following two programs
  • Programming Problem 1
  • Write a program that generates all the factors of
    a number entered by the user. For instance, the
    number 12 has the factors 2 2 3. This program
    has the following requirements
  • A. The user must enter a positive integer. If the
    user enters something else, your program should
    output an error message and let the user enter a
    new value. Use a do/while loop to make sure the
    user input is successful.
  • B. The factors must be output in increasing
    order. The lowest factor your program should
    report is 2.
  • C. Your program should output 4 factors per line,
    each factor in a field of 10 characters. (Hint
    the number of factors output determines when to
    output endl!)
  • D. You will need a while loop to report the
    factors. Here are some helpful hints
  • 1. If (a b 0) then a is a factor of b.
  • 2. When you have found a factor, output the
    factor and then reduce the number you are working
    with by dividing the number by the factor ie) /
    a
  • 1. Design an algorithm in pseudocode to solve the
    problem. Make sure to include steps to get each
    input and to report the output. Include steps to
    deal with error cases as specified above.
  • 2. Identify three test cases, one using a number
    with 4 factors, one using a negative number, and
    one using a number with more than 4 factors. For
    each of the three test cases show what inputs you
    will use and what your expected outputs should
    be.
  • 3. Write the program to implement your algorithm.
    Test your program using your test cases.
  • Programming Problem 2
  • This program is designed to analyze the growth of
    two cities. Each city has a starting population
    and annual growth rate. The smaller city has the
    larger growth rate (required). Show the
    comparative populations of each city year by year
    until the smaller city has grown larger than the
    bigger city.

6
COMP 122 Lab 2 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    2-lab-report-and-source-code
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • Week 2 iLab
  • Complete the following two programs

7
COMP 122 Lab 1 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    1-lab-report-and-source-code
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • Week 1 iLab - Part 1
  • Follow the instructions in COMP
    122_W1_iLab_Part1_instructions.docx.
  • COMP 122
  • Week 1 iLab - Part 2
  • Complete the following two programs
  • Programming Problem 1
  • John wants to know the values of the area and
    perimeter of a rectangle. John can take
    measurements of the length and width of the
    rectangle in inches. John's measurements are
    expected to be accurate to within 0.1 inch.
  • 1. Identify the inputs and outputs of the
    problem.
  • 2. Identify the processing needed to convert the
    inputs to the outputs.
  • 3. Design an algorithm in pseudo code to solve
    the problem. Make sure to include steps to get
    each input and to report each output.
  • 5. Write the program to implement your algorithm.
    Test your program using your test cases. Did your
    program produce the values predicted in your test
    cases? Explain.
  • 4. Identify two test cases, one using whole
    number values, and one using decimal number
    values. For each of the two test cases show what
    inputs you will use and what your expected
    outputs should be.

8
COMP 122 Lab 7 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    7-lab-report-and-source-code
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • The focus of this lab is on using strings. You
    will have an opportunity to work with both C
    style strings and the string data type. This lab
    also gives you an opportunity to use what you
    have learned previously, including using
    functions, array processing, repetition, and
    selection. You will also have an opportunity to
    work with file input and output.
  • You are to design and implement a program which
    does encryption and decryption of data from
    files. Encryption is the process of taking plain
    lines of text and performing some algorithmic
    transformation on the data to create an encrypted
    line of text which looks nothing like the
    original. Decryption is the process of taking an
    encrypted line of text and performing some
    algorithmic transformation on the data to recover
    the original line of plain text.
  • Encryption and Decryption Approach
  • Our approach to encryption and decryption
    involves two strings. The first is an encryption
    / decryption string which we will allow to be up
    to 128 lower case alphabetical characters in
    length. The second string is a line of text from
    a file that is to be encrypted or decrypted.
  • Our basic strategy for encrypting data is based
    on mapping alphabetical characters to specific
    values, then doing some simple mathematical
    operations to create a new value. First of all,
    every character in either the encryption string
    or the input string is mapped to a number between
    0 and 25 based on its position in the alphabet.
  • 0
  • 1
  • 25

9
COMP 122 Lab 5 Lab Report and Source Code
  • To purchase this material click below link-
  • http//www.homeworkflip.com/comp-122/comp-122-lab-
    5-lab-report-and-source-code
  • For More Tutorials Click Below link-
  • http//www.homeworkflip.com
  • Week 5 iLab
  • Objectives
  • Apply structured and modular design principles to
    write programs that meet written specifications
    and requirements. Develop a pseudo-code design
    using appropriate program structure (sequence,
    selection, repetition and nesting) to solve a
    given programming problem. Use appropriate
    selection and repetition statements to implement
    the design. Create user-defined functions to
    implement a modular design. Use appropriate
    parameter passing mechanisms for passing data
    into and getting data back from functions. Use
    ostream and iomanip formatting manipulators to
    display tabulated data. Design and implement a
    menu-driven interface.
  • Problem Description
  • This program is to give the user the option of
    converting a set of temperatures either from
    Celsius to Fahrenheit (C to F) or vice versa,
    from Fahrenheit to Celsius (F to C), or to quit
    the program. If the user selects either C to F or
    F to C, the program will prompt the user to enter
    three integer values, a starting temperature, an
    ending temperature, and an increment. After these
    values have been entered the program will display
    a table of equivalent C and F (or F and C)
    temperatures, from the starting temperature to
    the ending temperature and incrementing by the
    increment value each row.
  • The table must meet all of the following
    criteria
  • The table's column headings should display the
    degree symbol, e.g., C and F. The first column
    must be the "from" temperature (C for C to F or F
    for F to C) and the second column the "to"
    temperature (F for C to F or C for F to C). The
    calculated "to" temperatures are to be displayed
    to the nearest tenth of a degree (display exactly
    one decimal place, even if there is no fractional
    part, i
Write a Comment
User Comments (0)
About PowerShow.com