Split the string input_str = 'Srivastava_Rajni_002' to the person's second name, first name and unique customer code. In this example, second_name= 'Srivastava', first_name= 'Rajni', customer_code = '002'.
==================================================
Write a program using Python (version 3)using the concept of indexing and slicing and using substring or any general pattern .Also explain the logic and concept because i am not understanding.
input_str = 'Srivastava_Rajni_002'
splits = input_str.split("_")
second_name = splits[0]
first_name = splits[1]
customer_code = splits[2]
print("second_name =",second_name)
print("first_name =",first_name)
print("customer_code =",customer_code)


Split the string input_str = 'Srivastava_Rajni_002' to the person's second name, first name and unique customer...
Include a second string auto-implemented property that represents the name of the course’s instructor. Modify the constructor to specify two parameters—one for the course name and one for the instructor’s name. Modify method DisplayMessage such that it first outputs the welcome message and course name, then outputs "This course is presented by: ", followed by the instructor’s name. Use your modified class in a test app that demonstrates the class’s new capabilities. NOTE: You will need both a GradeBook file...
Detecting Substrings (C++ Version) Introduction A very common task that is often performed by programs that work with text files is the problem of locating a specific substring within the file. I am sure we’ve all done this many times when working with Word, Notepad, or other editors. Since we don’t have a GUI or other means of displaying the contents of a file all at once, let’s modify the problem slightly. Rather than locating a specific substring within a...
I wrote a program that takes a person's name and their 10 quiz scores from an input file and then prints it to an output file in a slightly different format that also has the average of their quiz scores. Here is an example INPUT Mike Johnson 100 45 68 99 34 66 88 99 88 66 OUTPUT Student Name Quiz Scores Average Johnson, Mike 100 45 68 99 34 66 88 99 88 66 75.30 It works fine when...
Java
Description This project is designed to help you practice for the second midterm examination. First you will hand write the code for the project, just as you would do on the examination. Then you will take your hand written code and enter it into eclipse and debug/fix it. This should help you identify challenges that you have in hand writing code that could cause problems on the midterm on Wednesday Write a program that generates platitudes, by writing each...
FIRST: Write code that prompts the user for the name of a text file, opens that file if it exists and reads the file one line at a time printing each line to the screen. You must implement the file read in a try/catch block rather than throwing the exception on the main method. NEXT: Modify your code so that the program takes the name of two files from the command line, opens the first file if it exists for...
Using Java, I am trying to read in a file with the format outlined below. "AARON, ELVIA J" WATER RATE TAKER WATER MGMNT "$87,228.00" "AARON, JEFFERY M" POLICE OFFICER POLICE "$75,372.00" "AARON, KARINA" POLICE OFFICER POLICE "$75,372.00" "AARON, KIMBERLEI R" CHIEF CONTRACT EXPEDITER GENERAL SERVICES "$80,916.00" "ABAD JR, VICENTE M" CIVIL ENGINEER IV WATER MGMNT "$99,648.00" "ABARCA, ANABEL" ASST TO THE ALDERMAN CITY COUNCIL "$70,764.00" "ABARCA, EMMANUEL" GENERAL LABORER - DSS STREETS & SAN "$40,560.00" "ABBATACOLA, ROBERT J" ELECTRICAL MECHANIC ...
You have just been hired as an analyst for an investment firm. Your first assignment is to analyze data for stocks in the S&P 500. The S&P 500 is a stock index that contains the 500 largest publicly traded companies. You have been given two sources of data to work with. The first is an XML file that contains the Symbol (ticker), company name, sector, and industry for every stock in the S&P 500, as of summer 2016. The second...
Code in C++
Function Prototypes
For the second part of the lab activity, you will be practicing writing function prototypes. Continue working on the same project from part A. First, rewrite the code so that you are using function prototypes for the functions getNumber.getMessage, and repeat. Remember that the prototypes go at the top of the file, followed by main, then the definitions of the three functions at the end. Second, you will be creating a new function (procedure) called...
Write a program that replace repeated three characters in a string by the character followed by 3. For example, the string aabccccaaabbbbcc would become aabc3ca3b3cc. When there are more than three repeated characters, the first three characters will be replaced by the character followed by 3. You can assume the string has only lowercase letters (a-z). Your program should include the following function: void replace(char *str, char *replaced); Your program should include the following function: void replace(char *str, char *replaced);...
Write a program that reads a string from the keyboard and tests whether it contains a valid time. Display the time as described below if it is valid, otherwise display a message as described below. The input date should have the format hh:mm:ss (where hh = hour, mm = minutes and ss = seconds in a 24 hour clock, for example 23:47:55). Here are the input errors (exceptions) that your program should detect and deal with: Receive the input from...