<commit_before>#!/usr/bin/env python

""" Assignment 1, Exercise 1, INF1340, Fall, 2015. Grade to gpa conversion

This module prints the amount of money that Lakshmi has remaining
after the stock transactions

"""

__author__ = '<NAME> Tyler'

# function to calculate net gain/loss of purchase
def calc_pur_cost(pur_num_shares, pur_share_cost, pur_comm_pct):
    net_pur_cost = pur_num_shares * pur_share_cost
    pur_comm_cost = net_pur_cost * (pur_comm_pct / 100)
    total_pur_cost = net_pur_cost + pur_comm_cost
    return total_pur_cost

# function to calculate net gain/loss of sale
def calc_sale_cost(sale_num_shares, sale_share_cost, sale_comm_pct):
    net_sale_cost = sale_num_shares * sale_share_cost
    sale_comm_cost = net_sale_cost * (sale_comm_pct / 100)
    total_sale_cost = net_sale_cost - sale_comm_cost
    return total_sale_cost

# function to calculate total gain/loss
def calc_total_cost():
    pur_num_shares = float(raw_input("Number of shares purchased: "))
    pur_share_cost = float(raw_input("Purchase price per share: "))
    pur_comm_pct = float(raw_input("Purchase commission percentage: "))

    sale_num_shares = float(raw_input("Number of shares sold: "))
    sale_share_cost = float(raw_input("Sale price per share: "))
    sale_comm_pct = float(raw_input("Sale commission percentage: "))

    pur_cost = calc_pur_cost(pur_num_shares, pur_share_cost, pur_comm_pct)
    sale_cost = calc_sale_cost(sale_num_shares, sale_share_cost, sale_comm_pct)

    total_cost = sale_cost - pur_cost

    return total_cost

profit = calc_total_cost()

print("Profit/loss: "+str(profit))

""" Test cases
Inputs:
    Number of shares purchased: 2000
    Purchase price per share: 900
    Purchase commission percentage: 3
    Number of shares sold: 2000
    Sale price per share: 942.75
    Sale commission percentage: 3

Expected output:
    Profit/loss: -25065.0

Actual output:
    Profit/loss: -25065.0
"""<commit_msg>Removed string from output<commit_after>#!/usr/bin/env python

""" Assignment 1, Exercise 1, INF1340, Fall, 2015. Grade to gpa conversion

This module prints the amount of money that Lakshmi has remaining
after the stock transactions

"""

__author__ = '<NAME> Tyler'

# function to calculate net gain/loss of purchase
def calc_pur_cost(pur_num_shares, pur_share_cost, pur_comm_pct):
    net_pur_cost = pur_num_shares * pur_share_cost
    pur_comm_cost = net_pur_cost * (pur_comm_pct / 100)
    total_pur_cost = net_pur_cost + pur_comm_cost
    return total_pur_cost

# function to calculate net gain/loss of sale
def calc_sale_cost(sale_num_shares, sale_share_cost, sale_comm_pct):
    net_sale_cost = sale_num_shares * sale_share_cost
    sale_comm_cost = net_sale_cost * (sale_comm_pct / 100)
    total_sale_cost = net_sale_cost - sale_comm_cost
    return total_sale_cost

# function to calculate total gain/loss
def calc_total_cost():
    pur_num_shares = float(raw_input("Number of shares purchased: "))
    pur_share_cost = float(raw_input("Purchase price per share: "))
    pur_comm_pct = float(raw_input("Purchase commission percentage: "))

    sale_num_shares = float(raw_input("Number of shares sold: "))
    sale_share_cost = float(raw_input("Sale price per share: "))
    sale_comm_pct = float(raw_input("Sale commission percentage: "))

    pur_cost = calc_pur_cost(pur_num_shares, pur_share_cost, pur_comm_pct)
    sale_cost = calc_sale_cost(sale_num_shares, sale_share_cost, sale_comm_pct)

    total_cost = sale_cost - pur_cost

    return total_cost

profit = calc_total_cost()

print(profit)

""" Test cases
Inputs:
    Number of shares purchased: 2000
    Purchase price per share: 900
    Purchase commission percentage: 3
    Number of shares sold: 2000
    Sale price per share: 942.75
    Sale commission percentage: 3

Expected output:
    Profit/loss: -25065.0

Actual output:
    Profit/loss: -25065.0
"""
{'fraction_non_alphanumeric': 0.0792462570986061, 'fraction_numerical': 0.023748064016520392, 'mean_word_length': 4.5997109826589595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4171771', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1300, 'n_words': 338}