Exercise Ex. 1: Find a regular expression over the alphabet { a, b} that contain exactly three a's. Ex. 2: Find a regular expression over the alphabet { a, Ex. 3: Find a regular expression over the alphabet { a, b} that has length of 3. } that end with ab. Ex. 4: Find a regular expression over the alphabet { a, b} that contain exactly two successive a's.
Q: Given the declaration Circle x = new Circle(), which of the following statement is most accurate. a.…
A: EXPLANATION: In Java, an int is a primitive data type, but an Integer is a Wrapper class. The data…
Q: Q2. (a) Write parametric equation to draw a circle using midpoint circle drawing algorithm and then…
A: Mid Point Circle Drawing Algorithm attempts to generate the points of one octant.
Q: A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a…
A: Since programming language not mentioned, using C++
Q: Write an application that reads an integer and determines and prints whether it’s odd or even.…
A: Output 1: Output 2:
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: Below is the modified python code: - Explanation: - Prompts the user to enter the string. Using a…
Q: Write a program that prompts the user to enter three cities and displays them in ascending order.
A: #include<iostream>#include<string.h>using namespace std;int main(){char nameAll[5][20],…
Q: One of the most popular games of chance is considered to be a game of dice, known as "Craps", which…
A: import java.util.Random;public class DiceGame {Â Â public static void main(String[] args) {Â Â Â Â…
Q: Complete the program shown in the 'Answer' box below by filling in the blank so that the program…
A: As per our guidelines we are supposed to answer only one question . Kindly repost other question as…
Q: Write a program that displays a random uppercase letter.
A: CODE: public class Main{ public static void main(String[] args) { char ch =(char)((int)'A'+…
Q: public static String pancakeScramble(String text) This nifty little problem is taken from the…
A: The given problem is related to programming language where the requirement is to implement a…
Q: Some sample runs of the program are included below (user input is in bold): > java ThreeWords Enter…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: OBJECT: To compute the net pay of an employee, given his/her pay rate, number of hours, and…
A: OBJECT: To compute the net pay of an employee, given his/her pay rate, number of hours, and…
Q: Assignment Write a program that moves a forester unit and a desert corps unit to a given target…
A: Assignment Write a program that moves a forester unit and a desert corps unit to a given target…
Q: The distance d between a point p(x,y), where x and y are the coordinates of p, and the center of a…
A: Hello Student Greetings from my side Hope you are doing great. I will try my best to answer your…
Q: palindromic prime is a prime number and also palindromic.For example, 131 is a prime and also a…
A: Program: //Definition for class "Main" public class Main { //Definition for main class public…
Q: Ethics are standards of right and wrong, good and bad. What makes the difference in ethical…
A: The question wants to know what does the above expression means, expression is:: "talks the walk” or…
Q: Q2/ Write a program that prints the block letter “B" in grid of stars like this: ****** * * ****** *…
A: First, middle, last lines have all *'s whereas in other lines, line starts and ends with *
Q: The Penny Pitch game is popular in amusement parks. Pennies are tossed onto a board that has certain…
A: ANSWER:-
Q: In JavaScript, there are two types of comments: 1. Single-line comments start with // 2. Multi-line…
A: 1. create the new method and pass a String argument.2. if condition string contains ("/*/") then…
Q: Implement the following two methods:/** Return true if the sum of every two sides is* greater than…
A: Program code: // import the Scanner package import java.util.Scanner; // create class MyTriangle…
Q: Ql: Write a program to read the length and width of a shape, determine whether it is square or…
A: NOTE : As per our guidelines we are supposed to answer only ONE(1) question. Kindly repost the other…
Q: Write a program that shows ten unique random words, all over ten characters long, that occur in the…
A: Below i have answered:
Q: Mad Libs is a game where the player selects words based on part of speech that are then used to fill…
A: In the given code below Declare the variable holder as a string. Declare the List name input of the…
Q: After every word on a line is spellchecked, it should be written to an output file called…
A: Solution: Note: I have implemented all the things. Please read the code carefully and if you have…
Q: In this assignment you will write a program that shows the valid moves of chess pieces. Your program…
A: C++ Code : bool isValid(int c[][MAX], int n){ int a[] = { 0, -1, 0, 1 }; int b[] = { 1, 0, -1, 0…
Q: a) Asks for an n positive integer, then draws a right-angled triangle of height n on the screen…
A: python used to answer this question
Q: Write a program in Visual Bas 6 that reads a number and determines if it is divisible by (4) or (5).
A: Algorithm Read the input from the user and divide with the 4 or 5 using If else find the output
Q: 3. Show the Huffman Code for each character in the following string. “boss demigoddess ship”
A: We are given a string and we are asked the Huffman code for each character. First, we will check…
Q: Write a program in which the Nibble Monster keeps asking for nibbles until the user enters 'Q' or…
A: NOTE : Since programming language is not mentioned. Therefore answering question in python language.…
Q: Write and test a function to meet this specification.drawFace (center, size, win) center is a Point,…
A: Write and test a function to meet this specification.drawFace (center, size, win) center is a Point,…
Q: Write a code to generate a point cloud that outlines a square. The coordinates of th corners of the…
A: #include <iostream>using namespace std; // Structure of a point in 2D spacestruct Point { int…
Q: Write an application that determines whether a phrase entered by the user is a palindrome. A…
A: import java.util.*; class palindrome{ void palin(){System.out.print("Enter the string you want…
Q: Write the R.E (Regular Expression) for the language 'L'. i. all words that contains the substring of…
A: Required : REGULAR EXPRESSION
Q: How to attempt? Question : The Card Game One day, Fred and his N friends were playing a card game in…
A: Input Specification: input1: An integer N denoting the number of cards(1<=N<=500) input2: An…
Q: CLASS AND OBJECT Write a program which calculates:| a. An area of a rectangle (length x width),…
A: As given, I need to write a program that calculates the area and perimeter of a rectangle using…
Q: Write a program that given two coordinate pairs and a third single coordinate will linearly…
A: #include<iostream> using namespace std; int main(){ float…
Q: (3-) Tony has succeeded in all his previous projects. Tony is (very delighted) to do another…
A: The Answer is given below step.
Q: In a game of tic-tac-toe, two players take turnsmarking an available cell in a 3 x 3 grid with their…
A: In a game of tic-tac-toe, two players take turnsmarking an available cell in a 3 x 3 grid with their…
Q: To write a regular expression literal that matches the substring of characters "go", you place it…
A: We need to find if the given statement related to regular expression is true or false.
Q: The Card Game One day, Fred and his N friends were playing a card game in which each player throws a…
A: As per question, we required an algorithm Algorithm: 1. First calculate the total sum of the input…
Q: Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so the…
A: Actually, given information is: A, B, and C = 2D, E, and F = 3G, H, and I = 4J, K, and L = 5M, N,…
Q: e. No Yes B? G No D H? Yes Yes E? D D. No F Yes E? D No
A: PSEUDOCODE -> 1. First, create a if condition if , If condition B is TRUE- G…
Q: The distance d between a point p(x, y), where x and y are the coordinates of p, and the center of a…
A: - We need to complete the code for the provided circle problem.
Q: Q4. Write an algorithm and draw a flow chart to get cgpa of student. If CGPA is more than equal to…
A: Algorithm: Step 1: StartStep 2: Read the CGPAStep 3: if CGPA >= 2.7 then go to step 4 . else go…
Q: Combine the first name, middle name, and last name and assign it as the 'fullname' of the hero. If…
A: Implementing given program in C++.
Q: Exercise 3- Valentine's Special [ Show some love (but don't get carried away) by writing a program…
A: code in next step
Q: In a game of tic-tac-toe, two players take turns marking an available cell in a 3 x 3 grid with…
A: Since you are not mentioning the programming language. Here we are using Java to complete the…
Step by step
Solved in 2 steps with 2 images
- Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following way: A, B, and C = 2 D, E, and F = 3 G, H, and I = 4 J, K, and L = 5 M, N, and O = 6 P, Q, R, and S = 7 T, U and V = 8 W, X, Y, Z = 9 Write a program that asks the user to enter a telephone number. The program should display the telephone number with all alphabetic characters that appeared in the original translated to their numeric equivalent. Do not translate characters other than letters. Ex: If the input is: 555-GET-food the output is: 555-438-3663 PythonU is upward, D is downward, L is left and R is right : Using the methods pickDir() and exractInt() as shown below, to write a simple automated game: how long does it take a robot to travel from a left line of a field to the right line? Assume field is 15 units apart (meters, kilometers, it doesn’t matter), and the robot starts on the left line. pickDir(): // return string with random direction and random distance (within maxDist) public static String pickDir (int maxDist) { Random r = new Random(); // random number generator // return direction + distance return ( "" + "LRUD".charAt( r.nextInt(4) ) + (r.nextInt(maxDist) + 1) ); } extractInt(): // returns integer from string, from pos p1 to p2: str = "D1" – extractInt(str,1,1); public static int extractInt (String str, int p1, int p2) { return ( Integer.parseInt( str.substring(p1, p2+1) ) ); } Write the main() method that keeps looping until the robot’s random left…using paintComponent(Graphics g) Write a program in java that, for four points A, B, C and P, • draws a triangle formed by ABC and a small cross showing the position of P; • displays a line of text indicating which of the following three cases applies: P lies (a) inside ABC, (b) outside ABC, or (c) on an edge of ABC. The user will specify the four points by clicking. please don't copy from chegg, correct answer gets up voted thanks.
- The Penny Pitch game is popular in amusement parks. Pennies are tossed onto aboard that has certain areas marked with different prizes. For example: The prizes available on this board are puzzle, game, ball, poster, and doll. At the end ofthe game, if all of the squares that say BALL are covered by a penny, the player gets theball. This is also true for the other prizes. The board is made up of 25 squares (5 x 5).Each prize appears on three randomly chosen squares so that 15 squares contain prizes.Create a penny_pitch application that displays a Penny Pitch board (use [ and ] toindicate squares) with prizes randomly placed and then simulates ten pennies being randomly pitched onto the board. After the pennies have been pitched, the applicationshould display a message indicating which prizes have been won, it any.Write a program that asks the user to enter a 1st color choice from a set of options: red, yellow or blue, and then asks them to enter a 2nd color choice from the remaining 2One interesting application of computers is drawing graphs and bar charts (sometimes called histograms). Write a script that reads five numbers between 1 and 30. For each number read, output HTML5 text that displays a line containing the same number of adjacent asterisks. For ex- ample, if your program reads the number 7, it should output HTML5 text that displays *******.
- java Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (0, 0) with width 10 and height 5. For example, (2, 2) is inside the rectangle and (6, 4) is outside the rectangle, as shown in the Figure. (Hint: A point is in the rectangle if its horizontal distance to (0, 0) is less than or equal to 10 / 2 and its vertical distance to (0, 0) is less than or equal to 5 / 2.) Here are sample runs of the program: Sample 1: Enter a point with two coordinates: 2 2 Point (2.0, 2.0) is in the rectangle Sample 2: Enter a point with two coordinates: 6 4 Point (6.0, 4.0) is not in the rectangle Analysis: (Describe the problem including input and output in your own words.) Design: (Describe the major steps for solving the problem.) Coding: (Go over your code step by step) Testing: (Describe how you test this program). In other words run your code with sample outputs.***Microsoft Visual Studios (C++)*** Write a program that given two coordinate pairs and a third single coordinate will linearly interpolate or extrapolate the third second coordinate. For example, let's say at 50 degrees Celsius the length of a metal rod is 5.4 cm and at 60 degrees Celsius the length is 5.5cm. I can interpolate the length at 53 degrees Celsius by doing 5.4cm + 3*(.1/10)=5.43cm. Your program does not need to continuously run, but should prompt the user for two coordinate pairs, the third first coordinate and return the extrapolated or interpolated third second coordinate.Write a program that prompts the user to enter the radius of the rings and draws an Olympic symbol of five rings of the same size with the colors blue, black, red, yellow, and green, as shown in Figure 3.5c.
- Write code so that you make another image below the image currently in the code so that they are next to each other but not touching each other. And Translate - A function that moves the graphic according to the given input . Grow - a function that increases the size of the graphic according to the given input public class BasicGraphicViewer{ public static void main (String[] args) { Rectangle r1 = new Rectangle(100,10,20,30); r1.draw(); Picture p1 = new Picture(); p1.load(“someimageurl”); // you can put any image link here. p1.draw(); } }In PYTHON Using one of the loop construct draw:- Twenty vertical lines- Each line of length 150 units(or pixels)- All lines aligned at the same top horizontal margin - Lines 10 units apart each other Note- The first line and all lines in odd positions(e.g. 1, 3, 5, etc.)should besolid lines- The second line and all lines in even positions(e.g. 2, 4, 6, etc.)should be dashed lines - - Set the length of solid segment to 10 units - - Set the length of the non-visible segment to 5 units Assumption- Use of Turtle libraryMany companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion: A, B, and C 2 D, E, and F 3 G, H, and I 4 J, K, and L 5 M, N, and O 6 P, Q, R, and S 7 T, U, and V 8 W, X, Y, and Z 9 Write a program that asks the user to enter a 10-character telephone number in the format XXX-XXX-XXXX. The application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For example, if the user enters 555-GET-FOOD the application should display 555-438-3663. Gaddis Tony. Starting Out with Python (2-downloads) (p. 367). Pearson Education. Kindle Edition.