Answer:
The output would be S 0.2 U 0.2 S 0.2 U 0.2 L 0.2 S 0.2 [ ]
Explanation:
Given that at each step output prints for example S 0.2.
Also given after every 5 steps, it should print a grid "[ ]".
if robot has been given S U S L S, it prints output as
S 0.2 U 0.2 S 0.2 U 0.2 L 0.2 S 0.2 [ ]
Let L be the set of exactly those strings over the alphabet \Sigma = {a, b, c, g}, that satisfy all of the following properties: the length of the string is equal to 5n+3, for some natural number n greater or equal than 0; all of the first (leftmost) 2n symbols are elements of the set {b, c, g}; all of the last (rightmost) 3n symbols are elements of the set {a, b}; the symbols at position 2n+1, 2n+2, and 2n+3 (from the left, i.e., after the first 2n symbols but before the last 3n symbols) are elements of the set {c, g}; Write a complete formal definition of a context free grammar that generates L. If such a context free grammar does not exist, state that the context free grammar does not exist, and prove it.
Answer:
S -> LSR
S -> M
M -> YYY
Y -> c | g
L -> XX
X -> b | c | g
R -> ZZZ
Z -> a | b
Explanation:
This is a long time ago, but I think this does what you want.
Start symbol S expands to LSR and allows you to grow L and R on either side as much as you want. Ultimately S must be replaced by M. Then you have a pattern like LLLLLMRRRRR.
We can then further break down L into 2 times b, c or g, and similar for M and R.
which data type uses %i as a format specifier
Answer:
A decimal integer
Explanation:
Hope this helps!
Identify at least three tips you would give to people to stay safe on the Internet so that their information stays secure. Explain why these tips are useful.
Answer:
1. Do not give away personal information such as your address, school you go to, or anything like that (obvious reasons
2. Do not share your passwords because people can hack into your things
3. Don't make guessable passwords such as Cookies, ILovePizza, Money
Define a method calcPyramidVolume with double data type parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volume of a pyramid with a rectangular base. calcPyramidVolume() calls the given calcBaseArea() method in the calculation.
Answer:
The method in C++ is as follows:
double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){
double baseArea = calcBaseArea(baseLength, baseWidth);
double volume = baseArea * pyramidHeight;
return volume;
}
Explanation:
This defines the calcPyramidVolume method
double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){
This calls the calcBaseArea method to calculate the base area of the pyramid
double baseArea = calcBaseArea(baseLength, baseWidth);
This calculates the volume
double volume = baseArea * pyramidHeight;
This returns the volume
return volume;
}
See attachment for complete program that include all methods that is required for the program to function.
Write an algorithm to sum to values
Answer:
There is no need to make an algorithm for this simple problem. Just add the two numbers by storing in two different variables as follows:
Let a,b be two numbers.
c=a+b;
print(c);
But, if you want to find the sum of more numbers, you can use any loop like for, while or do-while as follows:
Let a be the variable where the input numbers are stored.
while(f==1)
{
printf(“Enter number”);
scanf(“Take number into the variable a”);
sum=sum+a;
printf(“Do you want to enter more numbers? 1 for yes, 0 for no”);
scanf(“Take the input into the variable f”);
}
print(Sum)
Explanation:
hi there answer is given mar me as brainliest
A programmer writes 500 lines of computer code in 17 days. Must there have been at least 1 day when the programmer wrote 30 or more lines of code
Answer:
The answer is No
Explanation:
Given data
Total Lines of code= 500
Number of days= 17 days
Number of codes written per day= 500/17
Number of codes written per day= 29.4117
If we multiply 29.4117 by 17
=499.9989
=500 approx
Hence there was never a day when the programmer wrote 30 or more lines
Amy’s new summer job at the pool will put $9 per hour. Which term describes this type of hourly income?
A. Salary
B. Take-home pay
C. Wage
D. All of the above
Answer:
d
Explanation:
% Write a procedure that calculates the sum of the numbers in % a given range. The parameters to this procedure should be % as follows: % % 1. The low end of the range % 2. The high end of the range % 3. The sum of the values in the range % % If the low end equals the high end, then the sum should be % whatever value is equal to the low/high end (the range is % inclusive). If the low end is greater than the high end, % then failure should occur.
Answer:
The procedure in python 3 is as follows:
def add_range(low,high):
if low<= high:
total = 0
for i in range(low,high+1):
total+=i
return total
else:
return "Failure"
Explanation:
This defines the function/procedure
def add_range(low,high):
If low is less or equal to high
if low<= high:
Initialize total to 0
total = 0
Add up numbers in the range
for i in range(low,high+1):
total+=i
Return the total
return total
If low is greater, then return failure
else:
return "Failure"
A compound Boolean expression created with the _________ operator is true if either of its subexpressions is true.
what is software? what are two types of software?
Answer:
Software is the collection of programs which makes computer work. The two types of software are 1)Application software
2)System software
Describe Technology class using at least 3 adjectives
Answer:
clearly alien
typically inept
deadly modern
Explanation:
6.What does transgenic mean?
answer:
transgenic means that one or more DNA sequences from another species have been introduced by artificial means.
explanation:
transgenic plants can be made by introducing foreign DNA into a variety of different tissuestransgenic mice are one of the most common animal models usedrelating to or denoting an organism that contains genetic material into which DNA from an unrelated organism has been artificially introduced. being or used to produce an organism or cell of one species into which one or more genes of another species have been incorporated a transgenic mouse transgenic crops and produced by or consisting of transgenic plants or animals.
Scenario: A robot is sitting in a chair with its arms facing down. Write an algorithm, using pseudocode, to make the robot:
1. stand up2. walk forward until it senses a wall3. turn around4. walk back to the chair5. sit down in its original starting positionFinally, output the total number of steps taken.Commands--------In addition to our standard pseudocode commands, you must also use the following robot control commands:sitstandstep (one step forward)raise arms (parallel to floor)lower arms (pointing to floor)sense (only if arms are raised)turn (90 degrees right)Immediately after issuing a sense command, you can check whether the robot is at the wall as follows:if at wallor alternativelyif not at wallAssumptions-----------You must assume the following facts:The robot's initial sitting position is directly facing the target wall.There are no obstacles between the robot and the wall.The wall is 1 or more exact steps from the chair.The wall is sensed when it is less than 1 step from the robot's arms.The length of the robot's arms are slightly less than the length of 1 step.Your solution-------------Your solution must include all of the following:Adequate commentsInitialization and use of at least one variableSequential flow of controlConditional flow of controlIterative flow of controlHandling of any special casesOutput of the total number of steps takenYour solution-------------Your solution must include all of the following:Adequate commentsInitialization and use of at least one variableSequential flow of controlConditional flow of controlIterative flow of controlHandling of any special casesOutput of the total number of steps taken
Solution :
[tex]\text{Algorithm to}[/tex] stand [tex]$\etxt{up:}$[/tex]
step [tex]1[/tex]: [tex]$\text{stand}$[/tex]
step 2: [tex]\text{raise arms}[/tex]
[tex]\text{Algorithm to}[/tex] walk [tex]$\text{until it senses}$[/tex] a wall:
step [tex]1[/tex]: [tex]$\text{stand}$[/tex]
step 2: [tex]\text{raise arms}[/tex]
step 3: [tex]$\text{wallSensed}$[/tex]=false
step 4: [tex]$\text{numberOfSteps}$[/tex] = 0
step 5: if([tex]$\text{wallSensed}$[/tex]==true) then
[tex]\text{lower arms}[/tex]
step
else
if(sense)
[tex]$\text{wallSensed}$[/tex]=true;
else
step
[tex]$\text{numberOfSteps}$[/tex]++;
step 6: display [tex]$\text{numberOfSteps}$[/tex] to reach the wall
[tex]\text{Algorithm to}[/tex] turn around:
Step [tex]1[/tex]: if([tex]$\text{wallSensed}$[/tex]==true) then
turn
[tex]\text{raise arms}[/tex]
turn
[tex]\text{Algorithm to}[/tex] walk back[tex]$\text{ to the chair}$[/tex]:
Step [tex]1[/tex]: [tex]$\text{turn around}$[/tex]
Step 2: for i=[tex]1[/tex] to [tex]$\text{numberOfSteps}$[/tex] do
step
[tex]\text{Algorithm to}[/tex] sit back down:
Step [tex]1[/tex]: sit
Step 2: Lower arms
how do computers help us with our homework
xD I don't know if you said this as a joke, or if you're serious, but here:
A computer can be a helpful tool to complete your homework by giving you access to countless sources of information, it can also provide you with educational games which can enhance a child's learning ability by presenting learning as something fun and interactive as opposed to boring loads of repeated work which barely stimulate learning at all. But keep in mind that a computer can also take the opposite effect on a child's brain, and can gradually turn into addiction.
I hope this helps! :D
(FYI, I spent an unreasonable amount of time typing this all in, so I hope it makes any difference at all :P)
What can be viewed in the Tasks folder? Check all that apply
Answer: task details; appointments; to do list
Explanation:
Task folders, simply allows an individual organize their tasks in a logical manner. It performs an identical function just like a file directory.
Folders can be created in the root folder. Once can also create them as subfolder in the other files. The task details, appointments and the to do list can be viewed in the task folder.
I need solutions to below questions with python code:
Write a program, my_family.py For Loop A program, work-list.pyList
1. that contains a Tuple holding the names of friends or family members. Then use a For Loop to read and print the names.
2. that contains a of six integers. Use a list method to add one more integer. Use a list method to sort the list. Use a While Loop to print the entries.
Answer:
1) my_family.py
family = ('Dad', 'Mom', 'Agnes', 'David', 'Chris', 'Millie')
for name in range(len(family)):
print(family[name])
2) work_list.py
my_number = [2, 6, 3, 1, 8, 4]
# add items at the end of the list.
my_number.append(0)
my_number.append(5)
# sorts the list, default - ascending.
my_number.sort()
size = 0
while size < len(my_number):
print(my_number[size])
size += 1
Explanation:
The tuple and list data structures are ordered, using indexes to locate items in its container.
The family.py file uses the for-loop to iterate and print the family names in the tuple.
The work-list.py file contains a list of integers which is modified by adding items at the end of the list with the append method and a prints all the items using a while-loop.
Can you think of other businesses that might benefit from using voice response this system?
Answer:
call centers benfit big in this field
Explanation:
Write a program to prompt the user for hours worked to compute a gross pay for an employee, and he is paid 100/hour. If he worked for 50 hours in a week then he will get overtime pay for the extra hours he worked i.e. he will be paid 1.5 times of M100.00 for 10 hours (50-40)
Answer:
rate = 100
hours_worked = eval(input('enter number of hours worked'))
gross_pay = hours_worked * rate
if hours_worked <= 40 :
print(gross_pay)
else:
print(gross_pay + (1.5*rate*(hours_worked -40)))
Explanation:
Using python 3 :
The rate of pay is defined using the rate variable
The user is the prompted to enter the number of hours worked.
Gross_pay gives the mathematical evaluation of the amount paid base in rate and hours worked.
Since hours beyond 40 are paid as overtime. Then we have to add that to those who worked above 40 hours.
If hours_worked is 40 and below, then use gross pay
If gross pay is above 40 ; then the overtime fee is added to gross pay using the rate provided.
In python, sorry if it’s blurry
Answer:
nice
Explanation:
lst = [[6,-3,8,0,5,-1,2,-2],[-7,4,3,-5,8,9,1,6]]
neg_values = 0
for x in lst:
for y in x:
if y<0:
neg_values += 1
print(neg_values)
I wrote my code in python 3.8. I hope this helps
17.8.1: Writing a recursive math function. Write code to complete raise_to_power(). Note: This example is for practicing recursion; a non-recursive function, or using the built-in function math.pow(), would be more common.
Answer:
The recursion function is as follows:
def raise_to_power(num, power):
if power == 0:
return 1
elif power == 1:
return num
else:
return (num*raise_to_power(num, power-1))
Explanation:
This defines the function
def raise_to_power(num, power):
If power is 0, this returns 1
if power == 0:
return 1
If power is 1, this returns num
elif power == 1:
return num
If otherwise, it calculates the power recursively
else:
return (num*raise_to_power(num, power-1))
Which measurement symbol is this?
PLS HELP
Answer:
Foot.
Explanation:
Hope this helps!
What is a
a program
Answer:
-a collection of related measures or activities aimed at achieving a specific long-term goal.
-a set of pre-programmed software instructions for controlling the operation of a computer or other machine
-provide (a computer or other machine) with pre-programmed instructions for completing a task automatically
-Organize according to a schedule or plan.
Explanation:
Answer:
A program is an set of instructions given by a computer to perform particular task
LaToya is creating a program that will teach young children to type. What keyword should be used to create a loop that will print “try again” until the correct letter is typed
a. print
b. random
c. else
d. while
LaToya is creating a program that will teach young children to type. What keyword should be used to create a loop that will print “try again” until the correct letter is typed
Answer:d. while ✓
Explanation:
The while loop is used to repeat a section of code an unknown number of times until a specific condition is met.
[tex] \\ \\ [/tex]
Hope it helps
-------☆゚.・。゚ᵴɒƙυᴚᴀ_ƨȶäᴎ❀
what would be the result of running these two lines of code
Ski
Surf
Jog
Hike
Answer:
Jog
Explanation:
The variable options is a list containing 5 string values
options = ["ski", "surf", "jog", "bike", "hike"]
Indexing in python starts from 0 ; hence the index values of the list values are :
0 - ski
1 - surf
2 - jog
3 - bike
4 - hike
The statement ;
print(options[2]) means print the string at index 2 in the list named options
The string at index 2 is jog ;
Hence, the string jog is printed.
Which of the following describes an iteration in a computer program?
Answer:
a set of instructions that can be run multiple times throughout a program
Explanation:
Advancements in technology often make computer
hardware and software more convenient to use as
well as able to fit a variety of budgets. As
technology advances, it usually gets
smaller and less expensive.
larger and more expensive.
Answer: smaller and less expensive.
Explanation:
As technology advances, the architects of the devices that we use are getting more efficient in the production of said devices such that they are using better materials and techniques in production.
This has led to a situation where devices are increasingly getting smaller in size and cheaper to afford as well. For instance, compare the computers of today to those of the 90's. We have laptops now which are really slim and cost a fraction of what the bulky computers of those days cost.
Blank Are input instructions you give to a computer
Explanation:
A computer is a machine that can be programmed to accept data (input), process it into useful information (output), and store it away (in a secondary storage device) for safekeeping or later reuse. The processing of input to output is directed by the software but performed by the hardware.
Question # 4
Fill in the Blank
Complete the following sentence.
The first email was sent in
.
Answer:
1971
Explanation:
If there is more detail needed i'm sorry
Answer:
1971
Explanation:
#Nova
Have a great day!
:)
Write code to take a String input from the user, then print the first and last letters of the string on one line. Sample run: Enter a string: surcharge se Hint - we saw in the lesson how to get the first letter of a string using the substring method. Think how you could use the .length() String method to find the index of the last character, and how you could use this index in the substring method to get the last character.
//import the Scanner class to allow for user input
import java.util.Scanner;
//Begin class definition
public class FirstAndLast{
//Begin the main method
public static void main(String []args){
//****create an object of the Scanner class.
//Call the object 'input' to receive user's input
//from the console.
Scanner input = new Scanner(System.in);
//****create a prompt to tell the user what to do.
System.out.println("Enter the string");
//****receive the user's input
//And store it in a String variable called 'str'
String str = input.next();
//****get and print the first character.
//substring(0, 1) - means get all the characters starting
//from the lower bound (index 0) up to, but not including the upper
//bound(index 1).
//That technically means the first character.
System.out.print(str.substring(0,1));
//****get and print the last character
//1. str.length() will return the number of character in the string 'str'.
//This is also the length of the string
//2. substring(str.length() - 1) - means get all the characters starting
// from index that is one less than the length of the string to the last
// index (since an upper bound is not specified).
// This technically means the last character.
System.out.print(str.substring(str.length()-1));
} // end of main method
} //end of class definition
Explanation:The code has been written in Java and it contains comments explaining important parts of the code. Kindly go through the comments.
The source code and a sample output have also been attached to this response.
To run this program, copy the code in the source code inside a Java IDE or editor and save it as FirstAndLast.java
____________ RAM resides on the processor
Answer:
Brain of the computer i.e Random Access memory RAM resides on the processor
Explanation:
Brain of the computer i.e Random Access memory RAM resides on the processor. RAM is located in the central processing unit (CPU) also called processor which is located within the motherboard of the computer. It carry out the commands.