Question

In: Computer Science

Background Hands-On Assignments are designed to foster independent thinking and problem solving programming skills. This activity...

Background

Hands-On Assignments are designed to foster independent thinking and problem solving programming skills. This activity is closely guided by the course instructor. Students are encourages to ask instructor any questions related to this challenge. Similar to the course Exercises, this activity also has a Base Code.

The initially given Base Code to Start with this assignment:

This assignment is based on the project 6.9 of the course book.

--------------Start----------------

buttondemo.py     

breezypythongui.py

--------------End ----------------

---------------------------------------

Prompt

Task to Accomplish

The Base Code opens a window with label and two buttons. You will need to add:

  • A button to change the color of the label text

How to proceed:

  1. Make sure the Base Code (as offered in this exercise) is running without errors
  2. Add a button. Clicking on the button triggers the changeColor method.
  3. Work out changeColor().
  4. Give any necessary changes to make your final project pretty.

Submission

Submit both Screenshot image and your modified Python program.

Solutions

Expert Solution

Base code runs without any errors as long as the input file is in the same directory as that of the code's.

Modify input text file as per the requirement.

Input fiile

Lambert 34 10.50 1234 Chicago
Osborne 22 6.25 1235 Washington
Giacometti 5 100.70 1236 Newyork

fileName = input("Enter the input file name: ")
inputFile = open(fileName,'r')

#add two new fields for output header.(Choose the size of fields that looks good.I chose 20s and 15s)
print("%.15s%15s%15s%20s%15s"%("Name","Hours","Total Pay","Employee Number","Address"))

for line in inputFile:
    dataList = line.split()
    name = dataList[0]
    hours = int(dataList[1])
    payRate = float(dataList[2])
    totalPay = hours*payRate
    print("%.15s%10d%15.2f%15s%20s"%(name,hours,totalPay,dataList[3],dataList[4]))

#dataList[3] will contain Employee Number and dataList[4] will contain Address.So, I used them in print with out any variable assignment.

CODE SS

There are some pre written modules ( like pretty table) that help in better formatting of the output. (In case you feel that output isn't pretty).


Related Solutions

Hands-On Assignments are designed to foster independent thinking and problem solving programming skills. This activity is...
Hands-On Assignments are designed to foster independent thinking and problem solving programming skills. This activity is closely guided by the course instructor. Students are encourages to ask instructor any questions related to this challenge. Similar to the course Exercises, this activity also has a Base Code. The initially given Base Code to Start with this exercise: --------------Start---------------- guess.py   (also, see starters in the course FILES/StudentFiles/Exercise Starter Files) --------------End ---------------- Prompt Task to Accomplish The Base Code implements “guessing” of one number....
How does learning activity and instructional strategy foster the development of critical thinking and problem- solving...
How does learning activity and instructional strategy foster the development of critical thinking and problem- solving skills in the content area of social studies and various forms of the arts? The learning activity is “Read the Picture”’on different cultures in their homes past and present. The instructional strategy is to identify homes similar or different in how the cultures lived by drawing pictures of what they perceive to be similar or different to how they live in their homes.
1. List 4 skills that include creative thinking and problem solving: 2. List the stages of...
1. List 4 skills that include creative thinking and problem solving: 2. List the stages of a research process 3. Example of evidence of causality: a) Temporal sequence b) Nonspurious association c) A and B d) None of the above
Applying the 21 Synectics Steps The need for thinking and problem-solving skills dominates our lives. Individuals...
Applying the 21 Synectics Steps The need for thinking and problem-solving skills dominates our lives. Individuals must analyze problems in the workplace, at school, as a parent, and in many other daily situations. You have an opportunity to practice your problem-solving skills through this assignment. Assignment: Select one problem from the following list or define your own problem. Design a new textbook for a psychology class, science class, etc. Invent a new telephone. Design a new suitcase. Design new clothes...
Job postings often state that the successful applicant must have superior critical thinking and problem-solving skills....
Job postings often state that the successful applicant must have superior critical thinking and problem-solving skills. Yet employers tell college administrators that graduates, both from undergraduate and graduate programs, often lack these skills. Having read this week's assigned materials, how would you define critical thinking? Why are employers making these comments? Are they justified? Your response should be at least 250 words.
Discuss differences in brain activity associated with solving a problem by insight and solving a problem...
Discuss differences in brain activity associated with solving a problem by insight and solving a problem through step-by-step analysis.
Discuss differences in brain activity associated with solving problem by insight and solving a problem through...
Discuss differences in brain activity associated with solving problem by insight and solving a problem through step-by-step analysis.
This problem will give you hands-on practice with the following programming concepts: • All programming structures...
This problem will give you hands-on practice with the following programming concepts: • All programming structures (Sequential, Decision, and Repetition) • Methods • Random Number Generation (RNG) Create a Java program that teaches people how to multiply single-digit numbers. Your program will generate two random single-digit numbers and wrap them into a multiplication question. The program will provide random feedback messages. The random questions keep generated until the user exits the program by typing (-1). For this problem, multiple methods...
Summarize the strategic hands for problem-solving, and give an example of the meaning of each one...
Summarize the strategic hands for problem-solving, and give an example of the meaning of each one which of the following best summarizes the strategic hand there may be more than one strategy and provide an example of the meaning A there may be several strategies to solving the problem, however only one of them will find the correct answer. For example, there is more than one strategy to stop exit squared plus 3X +2 = 0 however, only one of...
Task: Apply mathematical problem solving skills to a variety of problems at the college level. To...
Task: Apply mathematical problem solving skills to a variety of problems at the college level. To accomplish this task, the students will 1. Identify what they are given and what they need to find; 2. Identify the type of problem they have been given and the tools necessary to solve the problem; 3. Correctly apply the tools to the information given to set up the problem; 4. Perform mathematically correct calculations to determine a solution; 5. Interpret their results in...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT