Rprofile - the first chunk of code executed
Q: Debugging - Run the code and find the problems Run the code and see what is happening. Complete the…
A: Procedure/Problem statement: The given code is to play gambling where the user starts with an…
Q: Q 4.1 I have provided the code I have written. All I need you to do is to rewrite the code. I need…
A: PROGRAM CODE: #include <stdio.h>#include <stdlib.h>#include <ctype.h>// start…
Q: 3) Implement the if __name__ == "__main__" : block at the bottom of this file to do the following:…
A: We have to write the code for implementing if __name__ == "__main__" : block at the bottom , also we…
Q: 6. NAME SEARCH In the Chap07 folder of the Student Sample Programs, you will find the following…
A: Solution in step 2:
Q: Python Programming Question
A: Program code: #Import random package import random #create randomanswers array random_answers=[]…
Q: Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases.…
A: The steps :Take input of the file name.Till the user does not enter quit, run an infinite loopIf the…
Q: Rap 1 Рop 2 Classical 0 Hip Hop 2 Rock 2 Lo Fi 0 c. The returned array should contain the follow…
A: Given Rap 1 Pop 2 Classical 0 Hip Hop 2 Rock 2 Lo Fi 0 c. The returned array should contain the…
Q: You will need to write one .cpp file for this question. two-dimensional array (2x2) of int numbers.…
A: 1. The user is asked to enter the number of rows and columns.2. If they are not equal, the array is…
Q: are some ways you can make code more efficient when using if-else blocks?
A: some ways you can make code more efficient when using if-else blocks
Q: a flow chart to describe an algorithm that takes a text file with format ID,First Name,Last…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: <?php /* NOTE: To see your output in the console, follow your output with a new line "\n" Write…
A: - We need to get the first value of the array passed as parameter in PHP.
Q: Use a nested loop to store a 25x12 flag (with 10x5 stars as *). Alternate = and - represent stripe…
A: answers for both the subparts are given below
Q: # Problem #1 Calculate Disney tickets with a menu Study the menu in Exx28geometry.py from my…
A: Start the program.Initialize the variable "total_cost" to 0.00.Display the menu options to the user…
Q: //18. refreshPosts //a. Dependencies: removeButtonListeners, deleteChildElements, displayPosts,…
A: // #18 const refreshPosts = async (posts) => { if (!posts){ return undefined; }…
Q: In C++Take the following code but -for the first option, change it so that instead of the middle…
A: Updated code in cpp: the changed code are in bold letters…
Q: Hello i keep getting this error?? im not user where i went wrong? it just keep added more? thank you
A: #include <stdio.h> # include <stdlib.h> int input(); void multiples(); void coins();…
Q: Attached Files: getRandomLib.h: // This library provides a few helpful functions to return…
A: Program Instructions:Include the necessary header files.Print hello message and as for a…
Q: 1. create a 4x4 crossword puzzle 2.make sure words like joy, bob,sun, bow are valid, 3.create a menu…
A: Explanation: Include the necessary header files. Then create a class that will contain the puzzle.…
Q: Code in c language, please. Thank you in advance. Assign listOfPizzas's first element's…
A: Assign listOfPizzas's first element's numberOfCalories with the value in listOfPizzas's second…
Q: // Add to this partially built code // fill in code where there is a TODO #include using namespace…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: #include #include using namespace std; int index1(char *T,char *P) { int t=0,p=0,i,j,r;…
A: To remove function, use all statements outside the function and remove the function header. instead…
Q: Write a program that will add and remove the following name and phone number list. (List on image…
A: The class name is Contacts. So commands to run will be javac Contacts.java and then java Contacts.…
Q: Here you will be writing a program to maintain the student database. Your program will maintain the…
A: #Menu Structure Program for a Student database #Five arrays to store name, ID, Score1, Score2 and…
Q: C++ Code: Oj is a cruel but wise student of his class. Because of his bad habits, one day his math…
A: ALGORITHM:- 1. Take input for the number of test cases. 2. Take input for the number for each test…
Q: Need help with this project in PYTHON. Thank you! Project to sort through data: - Make…
A: def bubble(self): def bubble_sort ( array ) : swap_test = False for i in range (…
Q: Goal 1: Update the Fractions Class Note: In this checkpoint 1. we will reduce fractions (i.e. 15/18…
A: Start.Create a Fraction class with private members numerator and denominator. It has methods to find…
Q: 2.20 LAB: Hypotenuse Given two numbers that represent the lengths of a right triangle's legs (sides…
A: Introduction: The name "Hypotenuse" in mathematics derives from the Greek word hypoteinousa, which…
Q: when i run my code why does it keep add more cents when e.g? 30 cent50 : 2 cent20 : 5 cent10 : 1…
A: //// main.c// Assignment1//// Created by Hassan omer on 15/10/21.// #include <stdio.h>…
Q: A CNC router has a tool which can be moved along three axes to carve shapes out of metal or wood…
A: Required C++ is mentioned below with output:
Q: Program Description: his assignment focuses on while loops and random numbers. Turn in a file named…
A: Please find the code below:
.Rprofile - the first chunk of code executed

Step by step
Solved in 2 steps

- #include <iostream>#include <string.h>using namespace std;int index1(char *T,char *P){int t=0,p=0,i,j,r;t = strlen(T);p = strlen(P);i=0;int max = t - p + 1;while(i<max){for(j=0;j<p;j++){if(P[j]==T[i+j]){r = i;break;}else r = -1;}i++;}return r;} int main(){ int l;char c[100];char d[100];cout<<"Enter First String\n"; cin>>c;cout<<"Enter Second String\n";cin>>d;l = index1(c,d);cout<<l; return 0;} Note: Remove FuncationC PROGRAMMING HELP I need help fixing an old assignment of mine. The point of the script is to read the pasted/attached Number_new.txt file's contents, meant to represent a classes' final grades out of 100 percent, and print an .exe screen as well as another .txt file that repeats the grade number with a letter grade and a PASS or FAIL next to it. At the end it needs to say how many students passed and how many failed. Nothing too complicated with the grading, just 90.0 and up is an A, 80.0 to 89.99 is a B, etc. And of course, anything below 60.0 is an F/FAIL. Please NO IOSTREAM.H OR CACIO.H! I cant use those header files. Below is the script: #include<stdio.h>#include<math.h>#define THEFILE "Number_new.txt" int main(){ float r0[10]; float rr[10]; FILE *fp; char line[81]; fp = fopen(THEFILE, "Number_new.txt"); if (fp != NULL) { /* The file is open. */ printf("%7s %7s %7s %7s %7s %7s %7s %7s %7s %7s\n", "0", "0.01",…• Use a while loop • Use multiple loop controlling conditions • Use a boolean method • Use the increment operator • Extra credit: Reuse earlier code and call two methods from main Details: This assignment will be completed using the Eclipse IDE. Cut and paste your code from Eclipse into the Assignment text window. This is another password program. In this case, your code is simply going to ask for a username and password, and then check the input against four users. The program will give the user three tries to input the correct username-password combination. There will be four acceptable user-password combinations: • alpha-alpha1 • beta-beta1 • gamma-gamma1 • delta - delta1 If the user types in one of the correct username-password combinations, then the program will output: "Login successful." Here are a couple of example runs (but your code needs to work for all four user-password combinations): Username: beta Type your current password: beta1 Login successful. Username: delta Type…
- Write a code segment that searches a Grid object for a negative integer. The loop should terminate at the first instance of a negative integer in the grid, and the variables row and column should be set to the position of that integer. Otherwise, the variables row and column should equal the number of rows and columns in the grid. *Pythonmy_round(number, integer): Based on the built-in round(...) function. Takes an integer or float and returns a rounded float value that is the number rounded to the second argument's decimal place. First argument can be any float or integer. Second argument must be an integer. Examples: my_round(1234.5678, 2) and round(1234.5678, 2) should return 1234.57. my_round(1234.5678, -2) and round(1234.5678, -2) should return 1200.0.COMPLETE TO DO's (do not copy other responses to this question if you do ill downvote) recv.cpp #include <stdio.h>#include <stdlib.h>#include <string.h>#include <fcntl.h>#include <mqueue.h>#include <sys/stat.h>#include <sys/types.h>#include <sys/mman.h>#include <unistd.h>#include <signal.h> // The name of the shared memory segment#define MSQ_NAME "/cpsc351queue" // The name of the file where to save the received file#define RECV_FILE_NAME "file__recv" #define MQ_MSGSIZE 4096 /*** Receive the file from the message queue*/void recvFile(){ // TODO: Define a data structure // of type mq_attr to specify a // queue that can hold up to 10 // messages with the maximum message // size being 4096 bytes // The buffer used to store the message copied // copied from the shared memory char buff[MQ_MSGSIZE]; // The total number of bytes written int totalBytesWritten = 0; // The number of bytes written int…
- Morse Code (python ) Morse code maps each letter of the alphabet to a series of dashes and dots (a = .-). The list of the Morse code for all English letters (from a to z) is provided below: [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","- -","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.-- ","--.."] Your goal here is to implement a function that takes a list of strings as its only parameter (called “words”). Each of the words can be transformed to Morse code by concatenation of a number of the above strings (without spaces). For example, the transformation of “ab” will be “.--...” (“.-” + “-...”). The word “ems” will also have the same transformation “.--...” (“.” + “--” + “...”). In this function, the goal is to return the number of the unique transformations in “words” list. Here is an example (none of this is needed to be printed, the function will only return one integer): Words = [“ab”, “a”, “ems”]Returned value: 2Explanation:…Build Brothers company in C A civil engineering company called Build Brothers has approached you to write a program to help some of their employees with getting their job quicker specially when it comes to calculating different equations in their construction projects. Currently, they use the following PDF to perform all their calculations: http://www.madison-lake.k12.oh.us/userfiles/680/Classes/16192/IED-Review%20Engineering%20Formula%20Sheet.pdf They are willing to develop a small software to calculate all the functions and calculations in the above cheat sheet. They have made this decision to reduce inherent human errors during calculation and improve efficiency. They think that these can be achieved by an “advanced calculator” that allows a user to choose an equation, provide the inputs, and calculate the outputs. Before the company invests on the final product, the have agreed on developing a proof-of-concept first. The idea is that your solution will ‘prove’ that a better…help finish the code of the provided code.
- Cassignm222 Assignment 2 features designing a program using pseudocode and then completing the program in Python using a list. M4Lab2 asks you to write a Drawing app in Python and Pygame using a list for the colors. Each lab asks you to write pseudocode that plans the program's logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program. # Step 1: Define a colors list to describe 3 colors.# Hint, use their RGB number values Step 2: define a radius variable for your pen at 5, 10 or 15# Test them to see which radius you prefer and use it # Step 3: write the elif for pressing button 2, similar to button 1 # Step 4: write the statement for button 2's color # Step 5: write the else statement for button 3 # Step 6: choose a color from the list??C++ code. Please describe what EACH line means/does. Ignore code that is commented out.python >>> feathered_pets=["canary", "parrot", "budgie", "hawk"]>>> furry_pets=["dog", "cat", "ferret", "hamster", "bunny"]>>> all_pets=furry_pets+feathered_pets what will give me the result ["parrot", "canary", "bunny"]











