palindrome is a string that reads the same forwards as backwards. Using only a xed number of stacks, and a xed number of int and char variables, write an algorithm to determine if a string is a palindrome. Assume that the string is read from standard input one character at a time. The algorithm should output true or false as appropriate
Solution :
check_palindrome[tex]$(string)$[/tex]
lower_[tex]$case$[/tex]_string[tex]$=$[/tex] string[tex]$. to$[/tex]_lower()
Let stack = new Stack()
Let queue = new Queue();
for each character c in lower_case_string:
stack.push(c);
queue.enqueue(c);
let isPalindrome = true;
while queue is not empty {
if (queue.remove().equals(stack.pop())) {
continue;
} else {
isPalindrome=false;
break while loop;
}
}
return isPalindrome
Input = aabb
output = true
input =abcd
output = false
12. But not parallelism, it is achievable to have concurrency in operating system threading?
Answer:
Yes, it is possible to have concurrency but not parallelism. Concurrency: Concurrency means where two different tasks or threads start working together in an overlapped time period, however, it does not mean they run at same instant.
Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Ex: If the input is: PYTHON the output is: 14
Complete question:
Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Ex: If the input is: PYTHON
the output is: 14
part of the code:
tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 }
Answer:
Complete the program as thus:
word = input("Word: ").upper()
points = 0
for i in range(len(word)):
for key, value in tile_dict.items():
if key == word[i]:
points+=value
break
print("Points: "+str(points))
Explanation:
This gets input from the user in capital letters
word = input("Word: ").upper()
This initializes the number of points to 0
points = 0
This iterates through the letters of the input word
for i in range(len(word)):
For every letter, this iterates through the dictionary
for key, value in tile_dict.items():
This locates each letters
if key == word[i]:
This adds the point
points+=value
The inner loop is exited
break
This prints the total points
print("Points: "+str(points))
Answer:
Here is the exact code, especially if you want it as Zybooks requires
Explanation:
word = input("").upper()
points = 0
for i in range(len(word)):
for key, value in tile_dict.items():
if key == word[i]:
points+=value
break
print(""+str(points))
In a multimedia presentation, when might voice-over be a better choice than placing the text on the screen?
when you have very little to say
when your audience is bored
when you have a lot to say
when you don’t want to write
In a multimedia presentation, the option that might be the voice-over when you have a lot to say.
What is multimedia presentation?A multimedia presentation is known to be a presentation where a person is said to often stand by themselves to present information via slides, video, etc.
In a multimedia presentation, the option that might be in the case of voice-over is when you have a lot to say as it is better to put it in a video format.
Learn more about multimedia from
https://brainly.com/question/24138353
#SPJ2
discuss file Management
With relevant examples.
in a Computer?
Answer:
File management is the process of administering a system that correctly handles digital data. Therefore, an effective file management system improves the overall function of a business workflow. It also organizes important data and provides a searchable database for quick retrieval
What type of information is best suited for infographies?
Answer:
All varieties of information, from bullet pointed text to numerical tables
Explanation:
Answer:
All varieties of information, from bullet pointed text to numerical tables
Explanation:
Write a program that asks for the user's name, phone number, and address. The program then saves/write all information in a data file (each information in one line) named list.txt. Finally, the program reads the information from the file and displays it on the screen in the following format: Name: User's Name Phone Number: User's Phone Number Address: User's Street Address User's City, State, and Zip Code g
Answer:
Amazon prime
Explanation:
c program that calculates the summation of integers from one to N. Allow the user to input an integer, then pass that number to a function that will calculate the sum of all integers up to N. For example, if the user inputs the number 5, then the function will return the sum 1 2 3 4 5. Allow the user to enter multiple integers, calling the function for each number. Use a sentinel value or similar method to terminate user input.
Answer:
Answered below.
Explanation:
#include <studio.h>
#include<conio.h>
void main(){
int I = 0;
int sumOfNumbers = 0;
int number;
printf("Input an integer: ");
("%d", &sumOfNumbers);
//Loop over while adding numbers
while(I <= number){
sumOfNumbers = sumOfNumbers + I;
I++;
}
printf("\n Sum of N numbers is: %d", sumOfNumbers);
getch();
}
Provide an example of formula (with proper syntax) that would check whether cell B5 has a negative number, and return a value of "negative" if it was and "not negative" the value was zero or higher.
Answer:
The formula is:
=IF(B3<0,"negative","not negative")
Explanation:
The formula can be split as follows:
= --> This begins all excel formulas
IF --> This means that we are writing an IF condition formula
B3<0, ---> This is the condition being tested
"negative", ---> This is the result is the condition is true
"not negative" ---> This is the result is the condition is false
(3) reasons why users attach speakers to their computer
Explanation
1.we connected speakers with computers for listening voices or sound . because the computer has not their own speaker.
2.Speakers are popular output devices used with computer systems.
3.Speakers are one of the most common output devices used with computer systems
User defined blocks of code can be created in
Snap using the
feature.
A. make a block
B. duplicate
C. create
D. define a function
You are going to visit a national park, and have never been there before. You are using a map to try and make the distance travelled as short as possible. There are 5 intermediate towns, A, B, C, D, and E, you may gln your way to the park, and the distances between the various locations are given below.
Answer:
eggs fishing didn't ysjffj
briefly explain 5 software which is either free or fee
Answer:
65
Explanation:
Answer:
65
Explanation:
Question 5/20
00:07:27
Agile Teams need to comply by the Agile Values and Principles but have flexibility to choose appropriate value-adding practices
Select the correct option(s) and click Submit.
True
False
SUBMIT
Explanation:
True. Is the true answer
Implement a class Clock whose getHours and getMinutes methods return the current time at your location. (Call java.time.LocalTime.now().toString() and extract the time from that string.) Also provide a getTime method that returns a string with the hours and minutes by calling the getHours and getMinutes methods. Provide a subclass WorldClock whose constructor accepts a time offset. For example, if you live in California, a new WorldClock(3) should show the time in New York, three time zones ahead. Which methods did you override
Answer:
Explanation:
The following code was written in Java. It uses the LocalTime import to detect the current time. Then it creates a getHours, getMinutes, and getTime method to correctly print out only the hours and minutes in a simple format. Then it does the same for the WorldClock subclass which takes in the time offset as an int parameter and adds that to the hours in your own timezone.
class Clock {
public String getHours() {
String hours = java.time.LocalTime.now().toString().substring(0,2);
return hours;
}
public String getMinutes() {
String min = java.time.LocalTime.now().toString().substring(3,5);
return min;
}
public String getTime() {
String time = getHours() + ":" + getMinutes();
return time;
}
}
class WorldClock extends Clock {
int timeZone = 0;
public WorldClock(int timeZone) {
super();
this.timeZone = timeZone;
}
public String getHours() {
String hours = String.valueOf(Integer.parseInt(super.getHours()) + 3);
return hours;
}
public String getTime() {
String time = getHours() + ":" + super.getMinutes();
return time;
}
}
class Test {
public static void main(final String[] args) {
Clock myClock = new Clock();
System.out.println("My Time: " + myClock.getTime());
WorldClock worldClock = new WorldClock(3);
System.out.println("My Time + 3: " + worldClock.getTime());
}
}
When someone refers to "space" on a computer or device, they are usually referring to _____, which allows the user to save a file for future use, even after the computer has been turned off. secondary storage the central processing unit (CPU) software primary memory
Answer:
it could either be the R.A.M or the hard drive
Explanation:
Answer:
Secondary Storage
Explanation:
Secondary storage is permanent, therefore, it fits the context of what the question is asking for.
Define an application program and give three of it's uses
Answer:
please give me brainlist and follow
Explanation:
Examples of an application include a word processor, a spreadsheet program, an accounting application, a web browser, an email client, a media player, a console game, or a photo editor. The collective noun application software refers to all applications collectively.
What are the vertical areas of the spreadsheet?
a
Verticies
b
Ventricals
c
Columns
d
Rows
Answer:
Columns
Explanation:
A spreadsheet may a explained as a tabular arrangement or arrays of cells which allows users to enter both numeric and string data for storage, manipulation and analysis. The spreadsheet program has both the vertical and horizontal cell arrangement with the vertical areas being reffered to as THE COLUMN which are labeled using alphabets arranged from A - AZ, AA - AZ, and so on to make up a total of 16384 columns on the Microsoft Excel spreadsheet program. Cells are located using a combination of column and row address. With row representing the horizontal area of the spreadsheet and labeled with digits. Therefore cells are usually refereed to as A1, (column A row 1) and so on.
Write a function, AvgList, that takes a single argument, a list, and returns the average (mean) of the numbers in the list. You may assume that all elements of the list are numeric (int or float), and that the list has at least one element. Hints: Use the function SumList that you wrote above. Use the built-in function len to get the number of elements in the list.
Answer:
Answered below
Explanation:
//Programmed in Java
public double avgList(int [] nums){
int I;
double sumOfNumbers = 0;
double averageOfNumbers = 0;
//Loop over to sum all elements in the list.
for(I = 0; I < nums.length; I++){
sumOfNumbers += nums[I];
}
//Calculate the average
averageOfNumbers = sumOfNumbers/ nums.length;
return averageOfNumbers;
}
Which factor distinguishes IOT devices from standard computing devices such as laptops and smart phones?
Answer:
PLS help me I'm tried
Haa plsssssss
what is work immersion and its nature
what does ICT stand for?
Information Communication Technology
ICT stands for 'Information Communication Technology'. Everyday usage of digital technology includes when you use a computer, tablet or mobile phone, send email, browse the internet, make a video call - these are all examples of using basic ICT skills and technology to communicate.
Joseph wants to take out the color of the background wall from an image what can Joseph do to achieve this
Answer:
Go to remove a background website
Explanation:
Explain why microcomputers are installed with TCP/IP protocols?
Answer:
microcomputers are installed with TCP/IP protocols because its a set of standardized rule that allows the computer to communicate on a network such as the internet
In order to implement the classic DoS flood attack, the attacker must generate a sufficiently large volume of packets to exceed the capacity of the link to the target organization. Consider an attack using ICMP echo request (ping) packets that are 500 bytes in size (ignoring framing overhead). How many of these packets per second must the attacker send to flood a target organization using a 0.5-Mbps link
Answer:
131 packets
Explanation:
Given
W (link ) =0.5 M bits, and Ping packets ( P ) = 500bytes
To flood a target organization that has a bandwidth of W bits using a packet Mbits, you will require a W / P packet
P ( required ) = 500 * 8 = 4000 bits
therefore the W /P packet is calculated as
= 0.5 M bits / 4000 bits
given that : 1 M bits = 1,048,576 bits
0.5 M bits / 4000 bits= 131.07
hence approximately 131 packets/ sec is required to flood the target organization
The following question is based on the following incomplete declaration of the class BoundedIntArray and its constructor definitions.
A BoundedintArray represents an indexed list of integers. In a BoundedIntArray the user can specify a size, in which case the indices range from 0 to size - 1. The user can also specify the lowest index, low, in which case the indices can range from low to low + size - 1.
public class BoundedIntArray
{
private int[] myItems; // storage for the list
private int myLowIndex; // lowest index
public BoundedIntArray(int size)
{
myItems = new int[size];
myLowIndex = 0;
}
public BoundedIntArray(int size, int low)
{
myItems = new int[size];
myLowIndex = low;
}
// other methods not shown
}
Consider the following statements.
BoundedIntArray arrl = new BoundedIntArray(100, 5);
BoundedIntArray arr2 = new BoundedIntArray(100);
Which of the following best describes arrl and arr2 after these statements?
a.
arrl and arr2 both represent lists of integers indexed from 0 to 99.
arrl and arr2 both represent lists of integers indexed from 0 to 99 . ,
b.
arrl and arr2 both represent lists of integers indexed from 5 to 104.
arrl , and, arr2 , , both represent lists of integers indexed from, 5 , to, 104, .,
c.
arrl represents a list of integers indexed from 0 to 104, and arr2 represents a list of integers indexed from 0 to 99.
arrl , represents a list of integers indexed from, 0 , to, 104, , and, arr2 , represents a list of integers indexed from, 0 , to, 99, ., ,
d.
arrl represents a list of integers indexed from 5 to 99, and arr2 represents a list of integers indexed from 0 to 99.
arrl represents a list of integers indexed from 5 to 99 , and arr2 represents a list of integers indexed from 0 to 99 . ,
Answer:
d.
Explanation:
Using the Java code provided, the creation of the BoundedIntArray objects would be that arrl represents a list of integers indexed from 5 to 99, and arr2 represents a list of integers indexed from 0 to 99. This is because arr1 is passing two arguments when it is being created, the first indicates the array size while the second indicates the lowest index. Since it passes two arguments it overrides the constructor and uses the constructor with two parameters. arr2 only passes one argument so it uses the original constructor which automatically sets the lowest index to 0.
The correct choice in this question is "arr1 is an array of numbers indexed from 5 to 104, while arr2 is an array of integers indexed from 0 to 99".
Array number:arr1 is for numbers 5 to 104, whereas arr2 is for numbers 0 to 99.Since the lowest index in arr1 is transmitted, it should be 5, and the array size should be 100. The index of the last member inside an array is also (size-1) since the array's lowest index is inclusive.Furthermore, arr2 is for 0 to 99, so because size, which would be 100, if passed, the lowest index is not. As a result, the lowest index by default is 0.Find out more about the Array here:
brainly.com/question/13107940
Describe how data is shared by functions in a procedure- oriented program
A student repeated the Styrofoam ball experiment. This time, the student rubbed the plastic rod on the cat's fur, but also rubbed the Styrofoam ball on the fur. How would the outcome of the investigation change if both objects were rubbed on the cat's fur? Use evidence and scientific reasoning to support your answer. Be sure to describe the charges and field interactions for both objects.
Answer:
Electrostatically charged rods. When you rub the plastic rod (polyethylene terephthalate, glycol modified, or PETG) with the wool cloth, the rod charges negative. When you rub the glass rod with the silk, the rod charges positive. ... The Coulomb, the unit of electrostatic charge, is named after him.
Explanation: i think
Answer:Electrostatically charged rods. When you rub the plastic rod (polyethylene terephthalate, glycol modified, or PETG) with the wool cloth, the rod charges negative. When you rub the glass rod with the silk, the rod charges positive. ... The Coulomb, the unit of electrostatic charge, is named after him.
Explanation:Electrostatically charged rods. When you rub the plastic rod (polyethylene terephthalate, glycol modified, or PETG) with the wool cloth, the rod charges negative. When you rub the glass rod with the silk, the rod charges positive. ... The Coulomb, the unit of electrostatic charge, is named after him.
Number the steps to describe how Tristan can complete
this task.
Cut the Television and related equipment row.
Paste the Television and related equipment row.
Click the plus sign on the left side of the table between
the last two rows.
Answer:
Cut the Television and related equipment row.Click the plus sign on the left side of the table between the last two rows.Paste the Television and related equipment row.Explanation:
In order to move the row, Tristan should first select the row and then cut it. This will ensure that the row will be moved completely instead of copied.
Tristan should then hover with the mouse between the last two rows and click on the plus sign on the left side. It will add a new row to the sheet. between the last two rows.
Tristan should then select the topmost cell and click paste. The television row will be pasted there and Tristan would have successfully moved it.
Answer:
2 3 1 Your Welcome
Explanation:
Given a number count the total number of digits in a number
Answer:
round up the log of the number
Explanation:
The ¹⁰log of a number gives you the number of digits if you round it up.