Make a program that lets users enter

Assignment Help JAVA Programming
Reference no: EM131840195

The goal of the script here for Python is to make a program that lets users enter their information as long as they want. The information I need is sex, age, and name. Then I have to print the number of males/number of females and an average age. Finally, the user has to be able to exit the program. Additionally, there must be an exception for spelling male or female wrong and an exception for ages outside of the 18-65 range. This is what I have so far but loops, lists and exceptions is quite confusing.

name = " "

gender = " "

age = " "

maleVariable = []

femaleVariable = []

ageVariable = []

name = raw_input ("Enter name here or press enter to end script:")

while True:

   if name == "enter":

       break

   else:

       age = raw_input ("Enter age here:")

       gender = raw_input ("Enter gender here (male or female):")

   if gender == "male":

       maleCount == maleCount + 1

       MaleInfo.append ((name, age))

   if gender == "female":

       femaleCount = femaleCount + 1

       FemaleInfo.append ((name, age))

name = ""

list = [ ]

while name <> " ":

   name = raw_input ("What is your name: ")

age = ""

list = [ ]

while age <> " ":

   age = raw_input ("How old are you: ")

sex = ""

list = [ ]

while sex <> " ":

   sex = raw_input ("Are you a male or female: ")

for i in MaleInfo:

   print i[0] + " is " + i[1] + " year old."

for i in FemaleInfo:

   print i [0] + " is " + i [1] + "years old."

cont = 'y'

cont not in "yes or no"

print femaleCount

print femaleAge/femaleCount

print maleCount

print maleAge/maleCount

print "Loop completed"

maleVariable = []

femaleVariable = []

Reference no: EM131840195

Questions Cloud

Why the us is an outlier as the sixth most danger country : Discuss your analyses and arguments on why the United States is an outlier as the sixth most dangerous country in the world.
What are some of the most widely used windows maintenance : 1. What are some of the most widely used Windows maintenance tools? Please share personal experiences using these tools.
What was the amount of the translation adjustment : Darron Co. was formed on January 1, 2011 as a wholly owned foreign subsidiary of a U.S. corporation. What was the amount of the translation adjustment for 2011
What are the tools available and limitations : You have found out that your team is not familiar with the Active Directory Tools. What are the tools available and limitations.
Make a program that lets users enter : The goal of the script here for Python is to make a program that lets users enter their information as long as they want.
Prepare a presentation about people of brazilian heritage : Prepare a PowerPoint presentation about People Of Brazilian Heritage.
Estimate of the total misstatement in inventory : Assume you tested inventory amounts totaling $1,000,000 and found $10,000 in overstatements. Estimate of the total misstatement in inventory
What relationship does an ethics committee have : What relationship does an ethics committee have in enforcing the advance directives of the patients in their care? Support your analysis with a one peer-review.
What is difference between business failure and audit risk : What's the difference between business failure and audit risk? Why should auditors be concerned about business failure

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd