1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
attashe74 [19]
3 years ago
15

Write a method , getemailusername, that is passed a string argument that is an email address and returns the user-name part. so

if "[email protected]" is passed, the method returns "mozart". assume that the argument will always be a correctly formatted email address.
Computers and Technology
1 answer:
MissTica3 years ago
4 0
<span>public String getemailssername (String aUser) { return aUser.substring(0, aUser.indexOf("@")); }</span>
You might be interested in
A program that accepts insurance policy data, including a policy number, customer last name, customer first name, age, premium d
valentina_108 [34]

Answer:

  1. policy_num = int(input("Enter policy number: "))
  2. lastName = input("Enter last name: ")
  3. firstName = input("Enter first name: ")
  4. premiumDate = input("Enter premius due date (mm/dd/yyyy): ")  
  5. numAcc = int(input("Enter number of driver accident in the past three years: "))
  6. if(policy_num <1000 or policy_num > 9999):
  7.    policy_num = 0  
  8. dateComp = premiumDate.split("/")
  9. month = int(dateComp[0])
  10. day = int(dateComp[1])
  11. year = int(dateComp[2])
  12. if(month < 1 or month > 12):
  13.    month = 0
  14.    day = 0
  15.    year = 0  
  16. else:
  17.    if(month == 1 or month == 3 or month == 5 or month == 7 or month == 8 or month == 10 or month == 12):
  18.        if(day < 1 or day > 31):
  19.            month = 0
  20.            day = 0
  21.            year = 0  
  22.    elif(month == 4 or month == 6 or month == 9 or month == 11):
  23.        if(day <1 or day > 30):
  24.            month = 0
  25.            day = 0
  26.            year = 0
  27.    elif(month == 2):
  28.        if(day < 1 or day > 29):
  29.            month = 0
  30.            day = 0
  31.            year = 0
  32. print("Policy number: " + str(policy_num))
  33. print("Last name: " + lastName)
  34. print("First name: " + firstName)
  35. print("Premium Date: " + str(month) + "/" + str(day) + "/" + str(year))
  36. print("Number of driver accidentin the last three years: " + str(numAcc))

Explanation:

The solution code is written in Python 3.

Firstly use input function to prompt user to enter all the necessary insurance policy data (Line 1 - 5).

Next create an if statement to validate the input policy number. If the policy number is not within the range of 1000 - 9999, set the policy number to zero (Line 7 -8).

Next, split the input premium date into month, day and year (Line 10 -13). It is followed by checking the month if it is between 1 - 12. If not, set the month, day and year to zero (Line 15 - 18). Otherwise the program will proceed to validate the month based on the maximum and minimum number of days for a particular month (Line 20 - 34). If the day is out of range, set month, day and year to zero.

Lastly, use print function to display the policy data (Line 36 - 40).

8 0
4 years ago
Select the correct answer..
kicyunya [14]

Answer:

A mid shot or medium shot

Explanation:

4 0
3 years ago
Can someone help me with this question, i know all except psuedocode, help me please
Shkiper50 [21]

Answer:

what should I help you

Explanation:

I don't no any thing because I an beginning

7 0
3 years ago
When choosing a new computer to buy, you need to be aware of what operating ____a0 it uses.
Lana71 [14]

Answer:

operating system

Explanation:

There are a lot of operating systems in the market. Ubuntu, red hat, windows, apple Macintosh etc. The choice of an operating system changes all the version of software used in the system. Therefore, while choosing a computer one must be aware of the operating system used in it.

7 0
3 years ago
Suppose a reference variable of type Double called myDouble has already been declared. There is also a double variable x that ha
eimsori [14]

Answer:

Double newMyDouble = new Double(x);

myDouble = newMyDouble2;

Explanation:

Here the new object newMyDouble is firstly the initial value of said 'double x'. In the second line myDouble is the reassigned the the newMyDouble, which is in fact, the value of x. This exercise helps you understand the syntax of using reference variables in JAVA and their assignment along with reassignment.

5 0
3 years ago
Other questions:
  • Assignment 3: Chatbot
    11·2 answers
  • Which statement BEST describes the benefits of muscular fitness training? A. High levels of muscular fitness can improve your se
    6·1 answer
  • Jody should select the
    5·1 answer
  • You are an IT technician at your company. The company has two small offices in different cities. The company's head office conta
    5·1 answer
  • Consider the classes below: public class TestA { public static void main(String[] args) { ​ int x = 2; ​ int y = 20 ​ int counte
    6·1 answer
  • Consider the following code segment, where num is an integer variable.
    6·1 answer
  • A program virus infect​
    10·1 answer
  • The table shows the price of apples in the local market. What is the cost of 12 pounds of apples? Apples (pounds) Price (dollars
    13·1 answer
  • Why is it important to prepare the farm resources before you start working? explain​
    14·1 answer
  • An embedded system describes computing technology that has been enclosed in protective shielding for security reasons. True or f
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!