Programming Homework Help

Programming Homework Help. BCIS 5390 Tarleton State University Chapter 3 Decision Structure Python Lab

Activity Details

Perform the following tasks:

  • Step 1: Create a Python (.py) file using IDLE (see Appendix B – Introduction to IDLE) using the required naming convention for Lab 03: CourseNumber_LastNameFirstInitial_LabNumber (e.g., 5390_SharpJ_Lab03)

Place the required identification information in Comment statements (see Section 2.4 Comments on page 39) at the top of the Python program. Within the body of the program implement the following requirements as described in the problem statement below:

Fast Freight Shipping Company has hired you to create a program which calculates and displays the shipping charge information for packages based upon the weight of the package and the state to which it is being shipped.

The current shipping rates per pound are provided below:

Weight of PackageRate Per Pound2 pounds or less$1.50Over 2 pounds but not more than 6 pounds$3.00Over 6 pounds but not more than 10 pounds$4.00Over 10 pounds$4.75

The Fast Freight Shipping Company has a limited geographic shipping area and only ships to locations in Arkansas (AR), Kansas (KS), Louisiana (LA), New Mexico (NM), Oklahoma (OK), and Texas (TX). The state sales tax rate for each is provided below (assume these values are constant while the program is running):

State AbbreviationState Sales Tax Rate
AR6.50%KS6.50%LA5.00%NM5.125%OK4.50%TX6.25%

The program should allow the user to enter the weight of the package (assume floating-point values may be entered) and the state abbreviation to which it will be shipped (assume state abbreviation may be entered in all lowercase or all uppercase or mixed case – see Table 8-2 on page 422 for converting to lower case or upper case for evaluation and display purposes). The program should then determine/calculate and display the rate per pound, the shipping charge, the state abbreviation, the state sales tax rate, the state sales tax, and the total shipping charge.

Validation:

If a value less than or equal to 0 is entered for the weight of the package, the program should display an error message such as “Invalid entry. Weight of the package must be greater than zero.” and the program should end. The program should not prompt the user for the state if the weight of the package is invalid.

If a value that does not match one of the specific states to which Fast Freight Shipping Company ships is entered, the program should display an error message such as “Invalid entry. State must be AR, KS, LA, NM, OK, or TX, and the program should end.

General Requirements:

  • Variable names MUST follow the naming rules (see page 43), be descriptive, and follow a standard naming convention, such as the textbook naming convention where multiple words are separated by underscores, commonly used by Python programmers (i.e, gross_pay) or camelCase convention (i.e., grossPay).
  • Named constants MUST use the standard naming convention provided in the textbook of all uppercase letters with multiple words separated by underscores.
  • Comment statements MUST be included for each major section of code to provide a brief description of its purpose. For example, at the beginning of the input statements, at the beginning of a decision structure, at the beginning of calculations, or output statements, etc. Single-line comments are adequate.
  • All output values representing currency should be displayed with $ and two decimal places (see Program 2-21 on page 70).
  • All output value(s) representing a percentage should be displayed with % and three decimal places (see example on page 72).

Sample Scenarios:

1. User enters -5 for weight of package:

Enter the weight of the package: -5
Invalid entry. Weight of package must be greater than zero.

2. User enters 0 for weight of package:

Enter the weight of the package: 0
Invalid entry. Weight of package must be greater than zero.

3. User enters 2 for weight of package and WY for state abbreviation:

Enter the weight of the package: 2
Enter the state abbreviation to ship to: WY
Invalid entry. State abbreviation must be AR or KS or LA or NM or OK or TX.

4. User enters 2 for weight of package and LA for state abbreviation:

Enter the weight of the package: 2
Enter the state abbreviation to ship to: LA
SHIPPING SUMMARY
The rate per pound is $1.50
The shipping charge is $3.00
The state to be shipped to is LA
The state sales tax rate is 5.000%
The state sales tax is $0.15
The total shipping charge is $3.15

5. User enters 6 for weight of package and ok for state abbreviation:

Enter the weight of the package: 6
Enter the state abbreviation to ship to: ok
SHIPPING SUMMARY
The rate per pound is $3.00
The shipping charge is $18.00
The state to be shipped to is OK
The state sales tax rate is 4.500%
The state sales tax is $0.81
The total shipping charge is $18.81

6. User enters 10 for weight of package and Ar for state abbreviation:

Enter the weight of the package: 10
Enter the state abbreviation to ship to: Ar
SHIPPING SUMMARY
The rate per pound is $4.00
The shipping charge is $40.00
The state to be shipped to is AR
The state sales tax rate is 6.500%
The state sales tax is $2.60
The total shipping charge is $42.60

7. User enters 25 for weight of package and tx for state abbreviation:

Enter the weight of the package: 25
Enter the state abbreviation to ship to: tx
SHIPPING SUMMARY
The rate per pound is $4.75
The shipping charge is $118.75
The state to be shipped to is TX
The state sales tax rate is 6.250%
The state sales tax is $7.42
The total shipping charge is $126.17

8. User enters 1000 for weight of package and nM for state abbreviation:

Enter the weight of the package: 1000
Enter the state abbreviation to ship to: nM
SHIPPING SUMMARY
The rate per pound is $4.75
The shipping charge is $4,750.00
The state to be shipped to is NM
The state sales tax rate is 5.125%
The state sales tax is $243.44
The total shipping charge is $4,993.44

  • Step 3: Run the program and correct any syntax/logic errors.

Programming Homework Help

Programming Homework Help

Programming Homework Help. Visualize the Distributions of The Variables R Program Questions

Please download the hotelsat.csv. Hotel management would like to use the insights from the findings and better their offerings for the right customer.

Q1. Management would like to know whether there is any pattern between how much each customer spend per night (avgRoomSpendPerNight) and overall satisfaction (satOverall) per segment (eliteStatus) as well as per visit purpose (visitPurpose). Please visually explore whether you are observing any pattern. Please briefly interpret the findings.

Q2. Management would like to know whether there is any pattern between how customers rate the city (satCity) and overall satisfaction (satOverall) per segment (eliteStatus) as well as per visit purpose (visitPurpose). Please visually explore whether you are observing any pattern. Please briefly interpret the findings.

Group mean differences (t-test and Anova)

Q3. (a) Visualize the distributions of the variables in the hotel satisfaction data via scatterplotMatrix. By looking at the distributions of the variables, do you see any need to transform any variables? Which variables need to be transformed if needed? And, please transform them as new variables and add to the dataset. [note: please use the log transformed version of the variables if you see need using them any questions in this block] (b) Please run the correlations among the variables (except the characters). Do you see any problem? Please explain.

Q4. Hotel management wants to know whether people who come from closer locations spend more/less money per night on room (avgRoomSpendPerNight) and on food (avgFoodSpendPerNight), and whether they stay longer/shorter (nightsStayed). They use the median distanceTraveled as the cut off point. People who are higher than the median distanceTraveled is coded as distant locations, and people who are lower than the median distanceTraveled is coded as close locations. The question is: are there statistical differences between people who come from closer distance (less than median value) and people who come from longer distance (more than median value) when it comes to (a) avgRoomSpendPerNight, (b) avgFoodSpendPerNight, and (c) nightsStayed? Please briefly explain [hint: you need to convert the distanceTraveled into a logical data type].

Programming Homework Help

Programming Homework Help

Programming Homework Help. Prince Sultan University Message Encryption and Decryption Java Program

write a java program to read a massage from a file to encrypt the massage using the following Modular mode (k.P1+P2) mode (ascii code book length) ,make prime number 1 (P1) and prime number 2 (P2) entered by the user, then decrypt the encrypted message into a new file.

Programming Homework Help

Programming Homework Help

Programming Homework Help. Arizona Western College Unbalanced Binary Search Tree Java Coding Worksheet

1. Draw a table that is going to be created if we use below commands:

HashIntSet h = new HashIntSet();
h.add(89);
h.add(67);
h.add(15);
h.add(105);
h.add(16);
h.add(77);
h.add(22);
h.add(10);
h.add(29);
h.add(87);
h.add(65);
h.add(78);90

You are adding methods to the class you created for in myBST.java(can’t upload java file, so I converted it to .word), please use provided template.

2. Implement rotateLeft and rotateRight. (It might be a binary tree rotation, See attached screenshot.)

Programming Homework Help

Programming Homework Help

Programming Homework Help. University of Connecticut R Coding Computer Science Questions

#INSTRUCTIONS

#Type the codes for each question

#Include answers to ALL questions in the script as a comment (with a #).

#If you are missing codes or answers in this script, points will be deducted.

### REGRESSIONS ###

install.packages(“readxl”)

library(readxl)

wine = read.csv(“https://docs.google.com/spreadsheets/d/e/2PACX-1vSYO2sPUeEvW1CE7wysL88oeFlfODEgQD2rl5aJqt9YlCwjs58pvibRucgDzavO-rCFs6VCgaEY2NzF/pub?gid=1979851222&single=true&output=csv”, header=TRUE)

attach(wine)

View(wine)

#Our data is named “wine” and we are going to explore what factors contribute to wine prices from the Bordeaux region in France.

#To view more information about this data & variables please visit: https://bookdown.org/egarpor/SSS2-UC3M/multlin-exa…

# 1. Let’s get farmiliar with our data by viewing a summary of it

# 2. Plot the the two variables “AGST” and “Price” using the plot() code

#Use the cor() code to look at the correlation and relationships beetwen all of the variables.

# *3. Which two variables have the strongest positive correlation? (Look for numbers closest to 1)

# *4. Use cor() code to look at the correlation between Price, AGST, and Age. What is it?

# AGST stands for the average growing season temperature in celsius. Price is the price of the wine.

# 5. Create a linear regression to predict the “Price” based on “AGST” name this regression “model1”

# *6. View a summary of our model

#What is the intercept, AGST coefficient, and R squared? What do they mean?

#The intercept is

#The AGST coefficient is

#This means that

#The R squared is

# 7. Add a fitted line to our model1 regression using the abline() code

#You can change color of fitted line with the codes below

abline(model1, col = 5)

abline(model1, col = “purple”)

# 8. Use the resid() code to view the residuals of model1. Our goal is to get them to be as close to 0.

# *9. Find the mean of the residuals of model1. Again, this should be close to 0. What is the mean of residuals for model 1?

# *10. Look at a histogram of the residuals for model1. Are they normally distributed?

# *11. Predict the price with AGST of 17.12 use the predict() code. What did you get?

#You could type out the formula instead

-3.4178+0.6351*17.12

### MULTIPLE REGRESSION ###

# *12. Run a regression to predict “Price” based on “AGST” and “HarvestRain”

# What is the intercept, what does this mean?

# What are the coefficients for AGST and HarvestRain? Interpret both of them. Are they both significant ***?

# What is the Adjusted R squared?

#The intercept is

#The coefficient for AGST is

#Coefficient for HarvestRain is

#This means that

#Significance ***

#The adjusted R squared is

# *13. Multiple Regression (all variables) AGST, HarvestRain, WinterRain, Age, FrancePop

# Run a multiple regression including all variables. Which ones are significant?

#Significance

Programming Homework Help

Programming Homework Help

Programming Homework Help. JJC Algebraic Expression in Programming Techniques Question

Assignment 1 An algebraic expression tree Goals: • Review and develop a deep and comprehensive understanding of the object-oriented paradigm • Review data structures such as lists, stacks, trees, etc. • Review programming techniques such as recursion A binary tree is a tree in which no node can have more than two children. An algebraic expression can be represented in a binary tree, an expression tree. The leaves of an expression tree are operands, such as constants or variable names, and the other nodes contain operators. This particular tree happens to be binary, because all the operators are binary, although this is the simplest case. It is possible for nodes to have more than two children. It is also possible for a node to have only one child, as is the case with the unary minus operator. In this assignment, you will design and implement an expression binary tree assuming that • there are only four operations: addition, subtraction, multiplication, and division • all operands are positive numbers • only Fully parenthesized algebraic expressions are used for testing To complete this assignment, you need to design a node, an expression tree, implement the design in Java, and test them in a driver program. Java is the required programming language for this assignment. If you need to review how to create an UML diagram or forget how to write comments in Javadoc style, see the examples in part III. The node class: A node contains a generic element, a reference to its left child, and a reference to its right child. It can’t be an inner class and it must have the following functionalities: • overloading constructors • getters/setters • other methods if any • overridden equals • overridden toString This node class must be a generic class. It will be used in the expression tree class or any classes where a node is required. When it is used in an expression tree, the element of a node can be an operand or an operator. The expression tree class: An expression tree object is a user-defined binary tree. It contains a reference to the tree (the root) and a reference to the associated expression- an infix. When requested, an expression tree can be visited in one of the three types of traversals, such as preorder traversal, inorder traversal, or postorder traversal. The best design for the tree traversals is to design a tree iterator, and use an iterator for traversals in an expression tree. To make it simpler for this assignment, we can simply include the traversal functionalities in the expression tree design. The following functionalitie

Programming Homework Help