Welcome to AssignmentCache!

Search results for 'eco'

10 Item(s)

per page

Grid  List 

Set Descending Direction
  1. ITS320 Module 1 Option 2 Create a Python Application that read two integers and print two lines

    ITS320 Module 1 Option 2 Create a Python Application that read two integers and print two lines

    Regular Price: $10.00

    Special Price $8.00

    ITS320 Module 1 Option 2 Create a Python Application that read two integers and print two lines

    Option #2: Create a Python Application
    Read two integers and print two lines. The first line should contain integer division, //, the second line should contain float division, /, and the third line should contain modulo division, %. You do not need to perform any rounding or formatting operations.
    Input Format The first line contains the first integer. The second line contains the second integer.
    Output Format Print the three lines as described above.

    Sample Input
    4
    3

    Sample Output
    1
    1.3333333333333333
    1

    Assignment Instructions
    1. Install Python3 on your computer if you don’t have it already installed. Make sure you check the box to include the Python executable in your environment path.
    2. Edit your Python program using your choice of editor such as Notepad, Notepad++, or Idle. Idle is a simple Python interactive development environment that installed with your Python package.
    3. Save your Python code in a file name ITS320_CTA1_Option2.py.
    4. Execute your Python code in command prompt as python ITS320_CTA1_Option2.

    Assignment Deliverables
    Submit the text file named ITS320_CTA1_Option2.py that contains your Python code into the Module 1 drop box.

    Learn More
  2. ITS320 Module 2 Option 1 Creating a Python Application for string validation

    ITS320 Module 2 Option 1 Creating a Python Application for string validation

    Regular Price: $10.00

    Special Price $8.00

    ITS320 Module 2 Option 1 Creating a Python Application for string validation

    Option #1: Creating a Python Application
    Python has built-in string validation methods for basic data. It can check if a string is composed of alphabetical characters, alphanumeric characters, digits, etc.
    str.isalnum() This method checks if all the characters of a string are alphanumeric (a-z, A-Z and 0-9).
    >>> print 'ab123'.isalnum()
    True
    >>> print 'ab123#'.isalnum()
    False
    str.isalpha() This method checks if all the characters of a string are alphabetical (a-z and A-Z).
    >>> print 'abcD'.isalpha()
    True
    >>> print 'abcd1'.isalpha()
    False
    str.isdigit() This method checks if all the characters of a string are digits (0-9).
    >>> print '1234'.isdigit()
    True
    >>> print '123edsd'.isdigit()
    False
    str.islower() This method checks if all the characters of a string are lowercase characters (a-z).
    >>> print 'abcd123#'.islower()
    True
    >>> print 'Abcd123#'.islower()
    FalseSAMPLE
    str.isupper() This method checks if all the characters of a string are uppercase characters (A-Z).
    >>> print 'ABCD123#'.isupper()
    True
    >>> print 'Abcd123#'.isupper()
    False

    Assignment Instructions:
    Write a Python program that performs the following tasks:
    1. Read from the console an arbitrary string S of length less than 50 characters.
    2. In the first output line, print True if S has any alphanumeric characters. Otherwise, print False.
    3. In the second line, print True if S has any alphabetical characters. Otherwise, print False.
    4. In the third line, print True if S has any digits. Otherwise, print False.
    5. In the fourth line, print True if S has any lowercase characters. Otherwise, print False.
    6. In the fifth line, print True if S has any uppercase characters. Otherwise, print False.
    7. Develop Python code that implements the program requirements.

    Assignment Deliverables:
    • Submit a text file containing your Python code into the Module 2 drop box. Name your file ITS320_CTA2_Option1.py

    Learn More
  3. CIS115 Week 5 Lab Race Time Sorting in Python

    CIS115 Week 5 Lab Race Time Sorting in Python

    Regular Price: $12.00

    Special Price $10.00

    CIS115 Week 5 Lab Race Time Sorting in Python

    CIS115 Week 5 Lab Overview

    Title of Lab: Race Time Sorting in Python

    Summary
    Store the times into arrays called Chevy[ ] and Ford[ ]. Then list the winner of each pair, giving the number of seconds the winner won by. At the end declare which team won based on which team had the most wins.

    Deliverables
    • A source code Python file.
    • A Word document containing both source code and the screen print of the program outputs.

    Lab Steps
    There are eight cars in each team called Chevy and Ford. One car from each team races its opponent on the drag strip. Read in the racing times for the eight Chevy cars and then read in the times for the eight Ford cars.

    Sample Match:
    ---Input Chevy Times---
    Enter time for Chevy Car 1: 5.4
    Enter time for Chevy Car 2: 7.2
    Enter time for Chevy Car 3: 4.0
    Enter time for Chevy Car 4: 9.1
    Enter time for Chevy Car 5: 5.8
    Enter time for Chevy Car 6: 3.9
    Enter time for Chevy Car 7: 6.2
    Enter time for Chevy Car 8: 8.1
    ---Input Ford Times---
    Enter time for Ford Car 1: 5.8
    Enter time for Ford Car 2: 6.9
    Enter time for Ford Car 3: 3.9
    Enter time for Ford Car 4: 9.2
    Enter time for Ford Car 5: 5.8
    Enter time for Ford Car 6: 3.8
    Enter time for Ford Car 7: 6.0
    Enter time for Ford Car 8: 8.5
    And the winners are:
    Chevy by 0.4 sec
    Ford by 0.3 sec
    Ford by 0.1 sec
    Chevy by 0.1 sec
    Tie!
    Ford by 0.1 sec
    Ford by 0.2 sec
    Chevy by 0.4 sec
    And the winning team is: F O R D !

    Specifications:
    • Accept the racing times for each of the Chevy cars into the array Chevy[ ].
    • Accept the racing times for each of the Ford cars into the array Ford[ ].
    • Then declare the wining car for each race, giving the winning time in seconds.
    • If the times are identical, then declare the race was a tie.
    • Finally, declare which team won the match, assuming a tie is possible.

    Learn More
  4. CYB 130 4.16 LAB Output range with increment of 10

    CYB/130 Week 3 Python LAB 4.16: Output range with increment of 10

    Regular Price: $8.00

    Special Price $3.00

    CYB/130 Week 3 Python LAB 4.16: Output range with increment of 10

    Write a program whose input is two integers. Output the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer.

    Ex: If the input is:
    -15
    30
    the output is:
    -15 -5 5 15 25

    Ex: If the second integer is less than the first as in:
    20
    5
    the output is:
    Second integer can't be less than the first.

    For coding simplicity, output a space after every integer, including the last.

    Learn More
  5. CYB 130 4.15 LAB Password modifier

    CYB/130 Week 3 Python LAB 4.15: Password modifier

    Regular Price: $8.00

    Special Price $3.00

    CYB/130 Week 3 Python LAB 4.15: Password modifier

    Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "q*s" to the end of the input string.
    i becomes !
    a becomes @
    m becomes M
    B becomes 8
    o becomes .

    Ex: If the input is:
    mypassword
    the output is:
    Myp@ssw.rdq*s

    Hint: Python strings are immutable, but support string concatenation. Store and build the stronger password in the given password variable.

    Learn More
  6. CYB130 6.28 LAB Replacement words

    CYB/130 Week 5 Python LAB 6.28: Replacement words

    Regular Price: $8.00

    Special Price $5.00

    CYB/130 Week 5 Python LAB 6.28: Replacement words
    Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced.

    Ex: If the input is:
    automobile car   manufacturer maker   children kids
    The automobile manufacturer recommends car seats for children if the automobile doesn't already have one.
    the output is:
    The car maker recommends car seats for kids if the car doesn't already have one.
    You can assume the original words are unique.

    Learn More
  7. PRG/211 Week 3 Lab 7.3 Loops: Output range with increment of 10  Program

    PRG/211 Week 3 Lab 7.3 Loops: Output range with increment of 10

    Regular Price: $8.00

    Special Price $3.00

    PRG/211 Week 3 Lab 7.3 Loops: Output range with increment of 10

    Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer.

    Ex: If the input is -15 30, the output is:
    -15 -5 5 15 25

    Ex: If the second integer is less than the first as in 20 5, the output is:
    Second integer can't be less than the first.

    For coding simplicity, output a space after every integer, including the last.

    Learn More
  8. DAT210 Week 5 Python LAB 6.22 Python and sqlite basics

    DAT/210 Week 5 Python LAB 6.22: Python and sqlite basics

    Regular Price: $10.00

    Special Price $4.00

    DAT/210 Week 5 Python LAB 6.22: Python and sqlite basics

    Write a Python program that connects to a sqlite database.
    Create a table called Horses with the following fields:
    • id (integer): a primary key and not null
    • name (text)
    • breed (text)
    • height (real)
    • birthday (text)

    Next, insert the following data row into the Horses table:
    id: 1
    name: 'Babe'
    breed: 'Quarter Horse'
    height: 15.3
    birthday: '2015-02-10'
     
    Output all records from the Horses table.
    Ex: With the above row inserted, the output should be:
    All Horses:
    (1, 'Babe', 'Quarter Horse', 15.3, '2015-02-10')

    Learn More
  9. DAT210 Week 5 Python 6.23 Python insert update sqlite3 datafiles

    DAT/210 Week 5 Python 6.23: Python insert/update sqlite3 datafiles

    Regular Price: $10.00

    Special Price $4.00

    DAT/210 Week 5 Python 6.23: Python insert/update sqlite3 datafiles

    Given is a Python program that connects to a sqlite database and has one table called writers with two columns:
    • name - the name of a writer
    • num - the number of works the writer has written

    The writers table originally has the following data
    name, num
    Jane Austen,6
    Charles Dickens,20
    Ernest Hemingway,9
    Jack Kerouac,22
    F. Scott Fitzgerald,8
    Mary Shelley,7
    Charlotte Bronte,5
    Mark Twain,11
    Agatha Christie,73
    Ian Flemming,14
    J.K. Rowling,14
    Stephen King,54
    Oscar Wilde,1
    Update the Python program to ask the user if they want to update entries or add new entries. If the name entered already exists in the writers table then the database record is updated, overwriting the original contents. If the name does not exist in the writers table, then add a new record with the writers name and number of works. The following TODO sections must be completed.
    • Check if a writer exists in the writers table
    • If the writer exists in the table, locate an entry to be updated by writers name and update the writer's value for num
    • If the writer does not exist in the table, add a new entry in the writers table and provide the value for name and num

    Ex if the input is:
    y
    J.K. Rowling
    30
    y
    Elton John
    y
    62
    n
    The output is:
    (ID, Name, Num)
    (1, 'Jane Austen', 6)
    (2, 'Charles Dickens', 20)
    (3, 'Ernest Hemingway', 9)
    (4, 'Jack Kerouac', 22)
    (5, 'F. Scott Fitzgerald', 8)
    (6, 'Mary Shelley', 7)
    (7, 'Charlotte Bronte', 5)
    (8, 'Mark Twain', 11)
    (9, 'Agatha Christie', 73)
    (10, 'Ian Flemming', 14)
    (11, 'J.K. Rowling', 30)
    (12, 'Stephen King', 54)
    (13, 'Oscar Wilde', 1)
    (14, 'Elton John', 62)

    Learn More
  10. PRG 211 Week 3 Lab 7.4 Countdown until matching digits Program

    PRG 211 Week 3 Labs

    Regular Price: $15.00

    Special Price $12.00

    PRG 211 Week 3 Labs

    Lab 7.1 Loops Convert to binary

    Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:

    As long as x is greater than 0
    Output x % 2 (remainder is either 0 or 1)
    x = x / 2
    Note: The above algorithm outputs the 0's and 1's in reverse order.

    Ex: If the input is 6, the output is:
    011
    (6 in binary is 110; the algorithm outputs the bits in reverse).


    Lab 7.2 Loops Varied amount of input data

    Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics.

    Ex: When the input is 15 20 0 5 -1, the output is:
    10 20
    You can assume that at least one non-negative integer is input.


    Lab 7.3 Loops Output range with increment of 10

    Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer.

    Ex: If the input is -15 30, the output is:
    -15 -5 5 15 25

    Ex: If the second integer is less than the first as in 20 5, the output is:
    Second integer can't be less than the first.

    For coding simplicity, output a space after every integer, including the last.


    Lab 7.4 Loops Countdown until matching digits

    Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical.

    Ex: If the input is 93, the output is:
    93 92 91 90 89 88

    Ex: If the input is 77, the output is:
    77

    Ex: If the input is not between 20 and 98 (inclusive), the output is:
    Input must be 20-98

    For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.

    Learn More

10 Item(s)

per page

Grid  List 

Set Descending Direction
[profiler]
Memory usage: real: 14680064, emalloc: 14261576
Code ProfilerTimeCntEmallocRealMem