Write a function that takes a string, returns void and has the effect of shifting the vowels of the string to the left. For example, if the input string was “hello class”, then after calling this function the string should contain “holla cless” (note that the first vowel is moved to the location of the last vowel). You can use an auxillary string if you want, but a nicer solution would work “in-place”
In: Computer Science
using C++
24. Using Files—Total and Average
Rainfall
Write a program that reads in from a file a starting month name, an
ending month name,
and then the monthly rainfall for each month during that period. As
it does this, it should
sum the rainfall amounts and then report the total rainfall and
average rainfall for the
period. For example, the output might look like this:
During the months of March–June the total rainfall was 7.32 inches
and the average
monthly rainfall was 1.83 inches.
Data for the program can be found in the Rainfall.txt file.
Hint: After reading in the month names, you will need to read in
rain amounts until
the EOF is reached, and count how many pieces of rain data you read
in.
You can use note pad to create a Rainfall.txt with the following data:
January
May
1.35 2.15 3.03 4.41 5.41
Please note that you must read the first line of the file as starting month and second line as ending month. Please do not hard code the starting and ending month into your program.
test case
During the months of January-May the total
rainfall was 16.35 inches and the average monthly
rainfall was 3.27 inches.
In: Computer Science
I need 40 question for requirements for Library System Management. Put 40 question please that we can get requirements for LSM.
In: Computer Science
Write the IEEE floating point representation (single precision) of 3.75 (Show all your steps to get full credit).
In: Computer Science
Having trouble getting started on this
Overview
As a programmer, you have be asked by a good friend to create a program that will allow them to keep track of their personal expenses. They want to be able to enter their expenses for the month, store them in a file, and then have the ability to retrieve them later. However, your friend only wants certain people to have the ability to view his or her expenses, so they are requesting that you include some sort of login functionality.
Instructions
For this challenge, you will start this application for your friend by concentrating on the login functionality. You will have a standard report in a text file where you will build login functionality to access. Below you will find the step by step instructions on how to develop this application.
what I have so far:
hasAt=False
while (not hasAt):
username= input("what is your username?")
if "@" not in username:
print ("wrong username")
print ("try again loser")
else:
password= input ("what is your password?")
hasAt=True
In: Computer Science
1) Only a single main class is required
2) The main class must contain a static method called "getInputWord" that prompts a user to input a word from the keyboard and returns that word as a String. This method must use "JOptionPane.showInputDialog" to get the input from the user (you can find info about JOptionPane in JavaDocs)
3) The main class must contain a static method called "palindromeCheck" that takes a String as an input argument and returns a boolean indicating whether or not that String is a palindrome. This method must utilize a Stack data structure to determine whether the word is a palindrome. Hint: Use the charAt() method of the String class to access each character of the word
Flow of the Program:
1) Read in a word from the user by calling the "getInputWord" method
2) Check if the word is a palindrome using the "palindromeCheck" method
3) Output the result to the screen using "JOptionPane.showMessageDialog" (you can find info about JOptionPane in JavaDocs)
In: Computer Science
Write a simple matching coefficient and jaccard similarity code in python.
For a example x = 10101 and y = 00101 what is the code to check those similarities in python?
In: Computer Science
SQL Assignment:
Provide a made-up scenario about when a database trigger could be used. There is no need to provide the syntax to create the trigger, as this would differ depending upon the actual design of the database. Only provide the scenario of when a trigger could be used.
In: Computer Science
Java
Math Tutor:
Write a program that displays a menu as shown in the sample run. You can enter 1, 2, 3, or 4 for choosing an addition, subtraction, multiplication, or division test. After a test is finished, the menu is redisplayed. You may choose another test or enter 5 to exit the system. Each test generates two random single-digit numbers to form a question for addition, subtraction, multiplication, or division. For a subtraction such as number1 – number2, number1 is greater than or equal to number2. For a division question such as number1 / number2, number2 is not zero.
Here is a sample run: (red indicates a user input)
Main menu 1:
Addition 2:
Subtraction 3:
Multiplication 4:
Division 5:
Exit Enter a choice: 1
What is 1 + 7? 8 Correct
Continue? (y/n) y
Enter a choice: 3
What is 2 * 3? 7
Your answer is wrong.
The correct answer is 6.
Continue? (y/n) n
Good bye!
In: Computer Science
In: Computer Science
What additional features of a MEAN stack applications have to be included in this course and why?
Provide references. 5 points: 3 points for the original post and one point for a meaningful reply.
In: Computer Science
* Javascript *
In: Computer Science
Using HTML: Create a Book of the Month Club Web site. The home page should describe the current month's selection, including book title, author, publisher, ISBN, and the number of pages. Create separate Web pages for book selections in each of the last three months. Add links to the home page that opens each of the three Web pages. Save the home page as BookClub.html, and save the Web Pages for previous months using the name of the month.
BOOK: Principles of HTML, XHTML, and DHTML: The Web Technologies
Series
CHAPTER 2 Building, Linking, Publishing Basic Web Pages
PROBLEM 2-1
In: Computer Science
PYTHON
A Class for a Deck of Cards
We will create a class called Card whose objects we will imagine to be representations of playing cards. Each object of the class will be a particular card such as the '3' of clubs or 'A' of spades. For the private data of the class we will need a card value ('A', '2', '3', ... 'Q', 'K') and a suit (spades, hearts, diamond, clubs).
Before we design this class, let's see a very simple main() (also called the client, since it uses, or employs, our class) that instantiates a few Card objects and displays their values on the screen. We want to do a lot of fun things with our Card, but not yet. We start very carefully and slowly.
from enum import Enum
def main():
card1 = Card()
card2 = Card('5')
card3 = Card('9', Suit.HEARTS)
card4 = Card('j', Suit.CLUBS)
card5 = Card('1', Suit.DIAMONDS)
if not card2.set(2, Suit.CLUBS):
print("GOOD: incorrect value (2 (int), CLUBS) passed to Card's set()\n")
if not card2.set('2', Suit.CLUBS):
print("BAD: incorrect value ('2', CLUBS) passed to Card's set()\n")
print(str(card1) + "\n" + str(card2) + "\n" +
str(card3) + "\n" + str(card4) + "\n"
+ str(card5) + "\n")
card1 = card4
# test assignment operator for objects
print("after assigning card4 to card1:")
print(str(card1) + "\n" + str(card4)
+ "\n")
We can't run this main() without embedding it into a full program that has the Card class definition, but let's look at a copy of the run anyhow, so we can see what the correct output for this program should be:
GOOD: incorrect value (2 (int), CLUBS) passed to Card's set() (A of Spades) (2 of Clubs) (9 of Hearts) (J of Clubs) (A of Spades) after assigning card4 to card1: (J of Clubs) (J of Clubs)
We can learn a lot about what class Card must be and do by looking at main() and the run. Let's make a list of things that we can surmise just by looking at the client.
card1 = Card()
card2 = Card('5')
card3 = Card('9', Suit.HEARTS)
card4 = Card('j', Suit.CLUBS)
card5 = Card('1', Suit.DIAMONDS)
We see that card1 is instantiated with no arguments. This tells us that the class has a constructor (always __init__()) that does not require any arguments. Do you remember how that's done? Right! Either a default constructor (no formal parameters) or a constructor with all default parameters. So it must be one of those types.
However, we also see that card2 is providing the constructor with one argument and card3, card4 and card5 with two arguments. So, we must also have at least a 2-parameter constructor, and whatever number of parameters it has, they must all be default parameters (not counting the self parameter).
card3 = Card('9', Suit.HEARTS)
The first argument, the
value, is passed to the
constructor as what data type? It is
surrounded by quotes '5', '9', 'j', so it must be a
string. (See Note On String Delimiters, below.)
But the suit is a little odd. It is a construct
like Suit.CLUBS or Suit.DIAMONDS with no quotes around it. Words
without quotes in Python usually refer to
variable names, but in this case, that's
not what they are. Here we are using
enumerated or enum
types. You may not have had enums in your first
course, so you will learn about them this week.In: Computer Science
(Use C++ language) CREATE A PROGRAM CALLED and or not.cpp THAT: ASKS USER FOR AGE Note: you must be 18 or older to vote && is the symbol for And | | is the symbol for Or ! is the symbol for Not USE AND, OR, OR NOT TO SEE IF THEY'RE OLD ENOUGH TO VOTE and display appropriate message USE AND, OR, OR NOT TO SEE IF THEY ENTERED A NUMBER LESS THAN 0 and display appropriate message USE AND, OR, OR NOT TO SEE IF THEY ENTERED 18 or higher and display appropriate message DISPLAY A MENU OF CHOICES: 1. Democrat 2. Republican 3. Independent ASK USER TO ENTER THE NUMBER OF THEIR CHOICE USE IF STATEMENT WITH == TO CHECK THEIR CHOICE use a different message for each choice if they enter something other than 1,2, or 3 use AND, OR, or NOT to find out display a message
In: Computer Science