Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
using python:
how to make sure a string ends with a certain word.
for example: I want to raise an AssertionError if an email given as input does not end in "@gmail.com".
CANNOT use .endswith( )
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Please help and thank you in advance. The language is Java. I have to write a program that takes and validates a date but it won't output the full date. Here is my current code: import java.util.Scanner; public class P1 { publicstaticvoidmain(String[]args) { // project 1 // date input // date output // Create a Scanner object to read from the keyboard. Scannerkeyboard=newScanner(System.in); // Identifier declarations charmonth; intday; intyear; booleanisLeapyear; StringmonthName; intmaxDay; // Asks user to input date System.out.println("Please enter month: "); month=(char)keyboard.nextInt(); System.out.println("Please enter day: "); day=keyboard.nextInt(); System.out.println("Please enter year: "); year=keyboard.nextInt(); // Formating months switch(month){ case1: monthName="January"; break; case2: monthName="February"; break; case3: monthName="March"; break; case4: monthName="April"; break; case5: monthName="May"; break; case6: monthName="June"; break; case7:…arrow_forwardDefine a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a newline. Ex: printFeetInchShort(5, 8) prints: 5' 8" Hint: Use \" to print a double quote. import java.util.Scanner; public class HeightPrinter { /* Your solution goes here */ public static void main (String [] args) { Scanner scnr = new Scanner(System.in); int userFeet; int userInches; userFeet = scnr.nextInt(); userInches = scnr.nextInt(); printFeetInchShort(userFeet, userInches); // Will be run with (5, 8), then (4, 11)}}arrow_forwardNeed help with this java problem. Some Websites impose certain rules for passwords.Write a method that checks whether a string is a valid password. The method must takes a password as a parameter and return a boolean value. If the password is valid, returns true, otherwise, return false. Suppose the password rules are as follows:- A password must have at least eight characters.- A password must contain only letters and digits.- A password must contain at least two digits. Please make sure you write a comment line to document what your method does. Write a program that prompts the user to enter a password, then call the method that checks the password, and displays "Valid Password" if the rulesare followed, or Invalid Password otherwise. The main program must allow the user to check multiple passwords. It should ask the user "Do you want to continue checking anther password (y/n)?"arrow_forward
- Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just one statement. Hint: Call findMax() twice in an expression. - I dont understand what I am doing wrong here, I keep getting an error code saying that non-static findMax(numA, numB) cannot be referenced from a static context. Anything helps! import java.util.Scanner; public class SumOfMax {public double findMax(double num1, double num2) {double maxVal; // Note: if-else statements need not be understood to// complete this activityif (num1 > num2) { // if num1 is greater than num2,maxVal = num1; // then num1 is the maxVal.}else { // Otherwise,maxVal = num2; // num2 is the maxVal.}return maxVal;} public static void main(String [] args) {double numA = 5.0;double numB = 10.0;double numY = 3.0;double numZ = 7.0;double maxSum = 0.0; // Use object maxFinder to call the methodSumOfMax maxFinder = new SumOfMax(); maxSum= (findMax(numA,numB)+findMax(numY,numZ)); System.out.print("maxSum is: " + maxSum);}}arrow_forwardimport java.util.Scanner; public class CircleAndSphereWhileLoop{ public static final double MAX_RADIUS = 500.0; public static void main(String[] args) { Scanner in = new Scanner(System.in); // Step 2: Read a double value as radius using prompt // "Enter the radius (between 0.0 and 500.0, exclusive): " // Step 3: While the input radius is not in the ragne (0.0, 500.0) // Display a message on one line (ssuming input value -1) // "The input number -1.00 is out of range." // Read a double value as radius using the same promt double circumference = 2 * Math.PI * radius; double area = Math.PI * radius * radius; double surfaceArea = 4 * Math.PI * Math.pow(radius, 2); double volume = (4 / 3.0) * Math.PI * Math.pow(radius, 3); // Step 4: Display the radius, circle circumference, circle area, // sphere surface area, and…arrow_forwardDefine the method printValue() that takes two integer parameters and outputs the product of all integers starting with the first and ending with the second parameter, followed by a newline. The method does not return any value. Ex: If the input is 3 7, then the output is: 2520 Note: Assume the first integer parameter is less than the second. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import java.util.Scanner; public class ValuePrinter { /* Your code goes here */ publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intnumber1; intnumber2; number1=scnr.nextInt(); number2=scnr.nextInt(); printValue(number1, number2); } }arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education