I need help with the 3.19.5 super karel cleanup challenge on codehs. every code i've tried so far is correct but doesn't do all of the worlds.

Answers

Answer 1

Using the knowledge in computational language in JAVA it is possible to write a code that super karel cleanup challenge on codehs.

Writting the code:

function start(){

sweep();

if(rightIsBlocked()){

while(leftIsClear()){

sweep();

goBack();

moveUp();

}

if(leftIsBlocked()){

if(ballsPresent()){

takeBall();

}

while(frontIsClear()){

if(ballsPresent()){

takeBall();

}

move();

}

if(ballsPresent()){

takeBall();

}

goHome();

}

}

}

function goBack(){

turnAround();

while(frontIsClear()){

move();

}

turnAround();

}

function moveUp(){

turnLeft();

if(ballsPresent()){

takeBall();

}

move();

turnRight();

}

function sweep(){

while(frontIsClear()){

if(ballsPresent()){

takeBall();

}

move();

}

if(frontIsBlocked()){

if(facingEast()){

if(ballsPresent()){

takeBall();

}

if(leftIsBlocked()){

goHome();

}

}

}

}

function goHome(){

if(facingEast()){

turnAround();

while(frontIsClear()){

move();

}

if(leftIsBlocked()){

turnAround();

}else{

turnLeft();

while(frontIsClear()){

move();

}

turnLeft();

}

}

}

See  more about JAVA at brainly.com/question/19705654

#SPJ1

I Need Help With The 3.19.5 Super Karel Cleanup Challenge On Codehs. Every Code I've Tried So Far Is

Related Questions

The following situation uses a robot in a grid of squares. The robot is represented by a triangle which is initially in the top left square facing downwards.
Create a solution that would enable the robot to be in the position found below. Make sure to use CAN_MOVE () to receive credit.

Answers

Using knowledge in computational language in python it is possible to write a code that Create a solution that would enable the robot to be in the position found below.

Writting the code:

import random

lis=[]

for i in range(0,10):

 num=random.randint(1,12)

 lis.append(num)

tot=sum(lis)

avg=tot/10

print(avg)

See more about python at brainly.com/question/18502436

#SPJ1

Calculate the standard deviation for the following data set: 2, 9, 10, 4, 8, 4, 12

What is the standard deviation and the mean

Answers

Answer:

2+5)6

Explanation:

if qujs is 9 then u is 10

eve is investigating a security incident where the user of a web application submitted an internal url to the application and tricked the web server into retrieving sensitive data from that url and displaying it as output. what term best describes this attack?

Answers

The term cross-site scripting is best describes this attack. Some web programs contain a form of security flaw known as cross-site scripting (XSS).

Some web programs contain a form of security flaw known as cross-site scripting (XSS). XSS attacks give attackers the ability to insert client-side scripts into web pages that other users are seeing.

A cross-site scripting flaw could be exploited by attackers to get around access restrictions like the same-origin policy. Up to 2007, over 84% of all security vulnerabilities identified by Symantec used web-based cross-site scripting.

Depending on the sensitivity of the data handled by the vulnerable site and the type of security mitigations applied by the site's owner network, XSS consequences can range from a little annoyance to a serious security issue.

To know more about cross-site scripting click on the link:

https://brainly.com/question/20316643

#SPJ4

What virtual, logically defined device operates primarily at the data link layer to pass frames between nodes?.

Answers

This vSwitch (virtual switch) or bridge is a logically defined device that operates at the Data Link layer to pass frames between nodes.

WHAT ARE NODES?

To put it simply, a node is any device that connects other devices connected to one another over a network and permits data to be sent and received from one endpoint to the other. Network nodes include hardware like printers, switches, and routers.An electronic gadget called a node. The physical components are what have the ability to send, receive, or forward data.Besides being an electronic device, a computer can send, receive, or forward data. As a result, we can argue that a computer is a node in a computer network for this reason. An electronic gadget called a node. The physical components are what have the ability to send, receive, or forward data.

Hence,A logically defined device called a vSwitch (virtual switch) or bridge operates at the Data Link layer to pass frames between nodes.

learn more about nodes click here:

https://brainly.com/question/13992507

#SPJ4

you are the it administrator for a small corporate network. some of your workstations are having issues, and you need to correct them with a firmware update. in this lab, your task is to: restart the computer and enter the bios. answer question 1. use the c:\bios updater.exe program to update the bios. restart the computer and enter the bios. answer question 2.

Answers

The proper way to fix the firmware issues is to update the firmware. This can be done automatically by Windows update. It also can be done manually by visiting the hardware manufacturer's website and downloading the correct firmware and installing it.

About BIOS

BIOS (Basic Input Output System) is the firmware that loads before your Windows or whatever operating system you have-run. It performs basic input and output procedures to check the system devices of your computer, including the RAM, keyboard, mouse, hard drive, and other hardwares. When there's no issues, it will load your operating system. To access BIOS hit the Delete key several times on booting mode, or Ctrl + Alt + Delete on older machines.

Learn more about Windows 10 https://brainly.com/question/15108765

#SPJ4

Designing a website for a new nonprofit organization is an example of

Answers

Answer:

A well-designed website can serve as the hub of your nonprofit's online presence, helping you educate new supporters, market programming and events, and pull in donations. For some nonprofits, however, creating a top-notch website design can feel impossible, especially if your team is new to using web design tools and tips.

If you've found yourself in a web design rut, you're in the right place. One of the best ways to kickstart your own design journey is to get inspired by other high-quality design work. By taking a look at other engaging and easy-to-use websites, you can see what's possible for your own website design and learn how to balance quality content with captivating aesthetics.

In this article, we'll showcase 30+ of the best nonprofit websites on the internet today, and then set you up to dig into creating your own with a few design tips. Specifically, we'll cover:

definition of Bystander

Answers

Answer:

According to the Oxford Dictionary a bystander is-
a person who is present at an event or incident but does not take part.

Explanation:

Basically someone who is there but does not play a role in anything that happens.

n processes are time-sharing the cpu, each requiring t ms of cpu time to complete. the context switching overhead is s ms. (a) what should be the quantum size q such that the gap between the end of one quantum and the start of the next quantum of any process does not exceed m ms? (b) for n

Answers

When M = 450, Q = 82 CPU use was wasted by 8.889%. When M = 90, Q = 10 Total CPU time lost was 44.44%. When M = 50,Q = 2 CPU time wastage was 80%.

The percentage of the CPU utilised during the designated time period is summarized in the CPU Utilization report. Normally, the Core uses between 30 and 40 percent of the entire CPU during off-peak hours and between 60 and 70 percent during peak hours. About 75% of opportunities to complete tasks are lost. The main memory delay, which can take up to 100 cycles, is the most frequent cause of this.

Data Provided:

Process = n

T = ms time

Context switch overhead is equal to S.

where M denotes overall overhead.

Learn more about wastage here-

https://brainly.com/question/2062616

#SPJ4

and are students at berkeley college. they share an apartment that is owned by . is considering subscribing to an internet provider that has the following packages​ available: package per month a. internet access $45 b. phone services 15 c. internet access phone services 50

Answers

They share an apartment that is owned by Brett. Brett is considering subscribing to an Internet provider that has the following packages available.

1. Evan Brett

Stand-alone $67.50 $22.50

Incremental (Brett primary)$65.00 $25.00

Incremental (Evan primary) $75.00 $15.00

Shapley value $70.00 $20.00

2.The Shapley value approach is recommended.

Evan Brett

Stand-alone $67.50 $22.50

Incremental (Brett primary)$65.00 $25.00

Incremental (Evan primary) $75.00 $15.00

Shapley value $70.00 $20.00

a. Stand-alone cost allocation method.

Evan: $75/$75 + $25×$90

=3/4 ×90

=67.50

Brett: $25/$75 + $25 ×$90

=1/4×$90 = $22.50

b. Incremental cost allocation method.

Let assume that Brett (the owner) is the primary user while Evan is the incremental user:

User Costs Allocated Cumulative Costs

Allocated

Brett $25 $25

Evan 65($90 – $25) $90

Total $90

This method may lead to some dispute over the ranking because Evan pays only$65 despite his prime interest in the more expensive Internet access package while Brett could argue that if Evan were ranked first he would have to pay $75 due to the fact he is the main Internet user. Which means Brett would only have to pay $15.

Assume Evan is the primary user and Brett is the incremental user:

User Costs Allocated Cumulative Costs

Allocated

Brett $25 $25

Evan 65($90 – $25) $90

Total $90

c. Shapley value (average over costs allocated as the primary and incremental user).

User CostsAllocated

Evan ($65 + $75) ÷2 = $70

Brett ($25 + $15) ÷2 = $20

Learn more about internet:

https://brainly.com/question/1364683

#SPJ4

paige is designing a web page that will contain instructions for how to use a new web conferencing tool at her work. she formats best practice tips in green, and she formats warning information in red. which employees might struggle with this formatting?

Answers

Some employees might struggle with this formatting if they are colorblind.

What is employees?
A person engaged by such an employer to perform a specific task is known as an employee. Employers are in control of determining an employee's wage, hours worked, and working conditions. In exchange, employees have benefits that contractors do not. To complete a specific task, an employer may hire a particular sort of worker. Contrary to contractors, who enjoy greater independence than employees, an employer has control over what an employee accomplishes and how it will be carried out. Following a selection as an employee following an application and interview procedure, the employee is hired by the business. The candidate is chosen once the company determines that they are the most qualified candidate for the position for which they are employing.

To learn more about employees
https://brainly.com/question/27953070
#SPJ4

factorial(n)  int:a.this function takes one argument n as a string and returns n! (the factorial of n), if n is not a non-negativeint, return none (hint: the string method isdigit() may be useful). your factorial calculation must be based on the following formula (you are allowed to calculate the values in reverse order, but you are not allowed to simply call math.factorial(n) or similar): note: by definition 0!

Answers

#include <bits/stdc++.h>

typedef int i;

i factorial(i n) {

   return (n>=1) ? n*factorial(n-1) : 1;

}

i main(i argc, char* argv[]) {

   

   i idx; std::cin>>idx;

   assert(idx>=0);

   std::cout << "Factorial of " << idx << " is " << factorial(idx) << std::endl;

   

   return 0;

}

Growth mindset is the idea that you can do something. By simply adding the word yet to a sentence, you can change your thoughts from a fixed mindset to a growth mindset. For example, "I can’t manage my time well" vs "I can’t manage my time well, yet. " After reviewing this week’s resources on the growth vs. Fixed mindset, we now understand how our thinking can influence the successes we achieve and how we overcome and view previous challenges

Answers

       Growth mentality: People who have a growth mindset think that even their most fundamental skills can be improved with commitment and effort; talent and intelligence are merely the starting point. This point of thinking fosters the resilience and passion of learning needed for outstanding success. (Dweck, 2015)

What a development mindset is and why it's critical to cultivate one.

       A growth mindset emphasizes the effort and hard work that lead to achievement while accepting (and even celebrating) challenges. Children that have a development mentality think they can learn anything and are adept at using the word YET.

       People that adopt a growth mentality might say things like: I still gain knowledge even when I fail. Criticism is a tool that improves me. There's always room for improvement. I can do anything with persistence and determination.

      "A growth mindset is the belief that one's abilities and intelligence may be enhanced through hard work and perseverance. They persevere in the face of challenges, take advice from criticism, and look for motivation in others' achievements."

To Learn more About Growth mentality, Refer:

https://brainly.com/question/24312405

#SPJ4

according to the federal geographic data committee, metadata for gis data should ideally include all of the following, except: a. financial information. b. spatial reference information. c. time period information. d. contact information.

Answers

Tomlinson has consequently earned the title of "father of GIS," especially for his use of overlays to further the spatial analysis of convergent geographic data.

In Canada, CGIS continued throughout the 1990s and helped create a sizable digitized land resource database. Five essential elements must be integrated for a GIS to function: hardware, software, data, people, and techniques. A GIS runs on hardware, which is the computer. GIS software is currently supported by a variety of hardware platforms, including standalone and networked desktop computers as well as centralized computer servers. The precise location of objects can be determined using global positioning systems, or GPS. GIS, or geographic information systems, are used to store data on maps. In managing land in the high hills, GPS and GIS are both helpful.

Learn more about hardware here-

https://brainly.com/question/15232088

#SPJ4

You have decided to edit your photos using the RAW file. What are some benefits of working with the RAW format? Select all that apply.

RAW files are processed, making it easier to edit
The images are already optimized
More color options when editing
More control over adjusting the White Balance

Answers

Since you have decided to edit your photos using the RAW file, the  benefits of working with the RAW format is option d: More control over adjusting the White Balance.

What are the benefits of using RAW?

One of the biggest advantages of RAW is the ability to restore shadows and highlights during post-processing without adding the granular noise typically associated with high ISO settings. If you have significantly overexposed or underexposed, RAWs are fairly forgiving.

Therefore, it has Better detail and dynamic range as you can capture more detail and a wider dynamic range from your camera sensor because to RAW's vastly increased image information.

Learn more about RAW format from

https://brainly.com/question/27977505
#SPJ1

Problem: Feed Nibble Monster Till Full

Write a program that generates a number in [0, 500] at the beginning -- this corresponds to how hungry the monster is -- and keeps asking the user to feed the monster until that number falls to zero.

Each time the user feeds the monster a nibble, hunger decreases by the decimal value of the character (i.e. if the user feeds 'A' hunger decreases by 65). But when the user feeds the monster some character that isn't a nibble, the hunger increases by the decimal value of the character (since puking depletes energy).

Use while loop.

Sample runs:

Notice the loop exits after one iteration, because hunger was very low and one nibble made the monster full:

Notice hunger increasing after non-nibble (pink highlight):

Notice that the program just keeps going when the user feeds the monster only non-nibbles. Do you think the program will keep running forever if the user never gives the monster nibbles?

Answers

Using the knowledge in computational language in JAVA it is possible to write a code that write a program that generates a number in [0, 500] at the beginning -- this corresponds to how hungry the monster is -- and keeps asking the user to feed the monster until that number falls to zero.

Writting the code:

import java.util.Scanner;

public class App {

   public static void main(String[] args) throws Exception {

       int hunger = getRandomNumber(0, 500);

       char ch;

       boolean flag = true;

       Scanner scan = new Scanner(System.in);

       while (hunger > 0) {

           System.out.println("Monster Hungry :E");

           System.out.println("H U N G E R: " + hunger);

           System.out.print("Feed Monster Nibble :0 ");

           ch = scan.next().charAt(0);

           if (Character.isLetterOrDigit(ch)) {

               hunger -= ch;

               if (hunger <= 0) {

                   System.out.println("Monster full :).\nYou may go");

               } else {

                   if (flag) {

                       System.out.println("yum!");

                       flag = !flag;

                   } else {

                       System.out.println("m04r f00d!");

                       flag = !flag;

                   }

               }

           } else {

               System.out.println("Ewww! :o=" + ch);

               hunger += ch;

           }

       }

       scan.close();

   }

   public static int getRandomNumber(int min, int max) {

       return (int) ((Math.random() * (max - min)) + min);

   }

}

See more about JAVA at brainly.com/question/12975450

#SPJ1

Why is jake not able to see the red jaguar? they are cleanig it for the day repairs are being done it is no longer in the pyramid it is to dark in the pyramid

Answers

Jake is not able to see the red jaguar because it is no longer in the pyramid.

What is Jaguar?

Jaguar is a luxury vehicle brand owned by Jaguar Land Rover, a British multinational automobile company headquartered in Whitley, Coventry, England. Jaguar Cars was the firm in charge of Jaguar car manufacture until its operations were entirely integrated with those of Land Rover to form Jaguar Land Rover on January 1, 2013. Jaguar began as the Swallow Sidecar Company in 1922, producing motorcycle sidecars before creating passenger car bodywork. Under the management of S. S. Automobiles Limited, the firm expanded to include full cars produced in collaboration with Standard Motor Co, many of which had the Jaguar model name.

To learn more about Jaguar

https://brainly.com/question/1671953

#SPJ4

Answer:

c. it is no longer in the pyramid

Explanation:

edge 2023

you are working at the command line and want to add the read-only attribute to a file and remove the hidden attribute. which command would you use?

Answers

To add the Read-only attribute and remove the Hidden attribute, use attrib +r -h. To remove the write protection on the chosen drive, enter "attributes disk clean read only" and hit "Enter".

At the Command prompt, enter the command attribute -r +s "drive :path folder name" (be sure to include the drive letter, entire path, and folder name). By using this command, the file's read-only attribute will be removed and replaced with a system attribute. Restart the computer and click the F5 key when you see the message "Starting MS-DOS" or the MS-DOS version if the computer is unable to load MS-DOS. The MS-DOS default settings should be loaded by pressing this key.

Learn more about command here-

https://brainly.com/question/14583083

#SPJ4

you have a computer that runs windows 10. your computer has two volumes, c: and d:. both volumes are formatted by using the ntfs filesystem. you need to disable previous versions on the d: volume. what should you do?

Answers

You have a computer that runs windows 10. your computer has two volumes, c: and d:. both volumes are formatted by using the ntfs filesystem. you need to disable previous versions on the d: volume. we should change it From System Properties, modify the System Protection settings.

By default, System Protection is often switched off for other drives and on for your boot disc. Type Control Panel into the search bar to launch the default Control Panel. Click Configure after selecting the drive you want to modify. To turn off or enable system protection, click the appropriate button.

System Protection, according to Microsoft, is a feature that creates and saves information about system files and settings on a regular basis. Additionally, System Protection keeps older versions of changed data.

If something goes wrong with your computer, the System Protection feature will let you go back in time and protect your whole Windows installation. The most important thing is to turn it on! Do the following to see if System Protection is activated: Activate File Explorer.

Learn more about windows:

https://brainly.com/question/25243683

#SPJ4

natasha, a network security administrator for an online travel portal, noticed that her website was the victim of an sql injection. she decided to study the sql queries to find which one made this vulnerability in the database, and she noticed the following sql code piece executed on the database: 'whatever' and email is null; what has been accessed by the attacker running this sql injection?

Answers

The information which has been accessed by the attacker running this SQL injection is that: The attacker has determined the names of different types of fields in the database.

What is SQL injection?

In Cybersecurity, SQL injection can be defined as code injection technique which is typically used by an attacker to exploit any web security vulnerability in a database especially by interfering with the queries that are being sent through a software application to the database.

What is a database?

A database can be defined as an organized and structured collection of data that're stored on a computer system as a backup and they're usually accessed electronically.

In this context, we can reasonably infer and logically deduce that this attacker was able to access the names of different types of fields which are stored in the online travel portal's database.

Read more on SQL injection here: https://brainly.com/question/25823241

#SPJ1

Complete Question:

Natasha, a network security administrator for an online travel portal, noticed that her website was the victim of an SQL injection. She decided to study the SQL queries to find which one made this vulnerability in the database, and she noticed the following SQL code piece executed on the database: 'whatever' AND email IS NULL;

What has been accessed by the attacker running this SQL injection?

The attacker accessed the data of specific users.

The attacker accessed the entirety of email address data from all users in the database.

The attacker has used the SQL injection to delete the table in the database.

The attacker has determined the names of different types of fields in the database.

An organizational ______ is someone whose accomplishments embody the values of the organization and whose accomplishments are put forth to motivate other employees to do the right thing.

Answers

An organizational hero is someone whose accomplishments embody the values of the organization and whose accomplishments are put forth to motivate other employees to do the right thing.

An organizational (hero) is a person whose achievements uphold the organization's principles and whose achievements are used to inspire other staff members to act morally. The concept of "organizational structure" describes how employees are arranged within a company and who they answer to. The classification of individuals by function is a common practice. Production, marketing, human resources, and accounting are a few typical organizational functions. Four distinct organizational culture types are identified by the Cameron and Quinn Competing Values Culture Model. They identify four cultures: market, ad hoc, clan, and hierarchical.

Learn more about organizational here-

https://brainly.com/question/28503044

#SPJ4

suppose we use a hash function hto hash n distinct keys into an array t of length m. assuming simple uniform hashing, what is the expected number of collisions?

Answers

Each key is assigned an integer in the range [0, N-1] by a hash function, where N is the size of the bucket array for the hash table.

The key concept is to index into our bucket array, A, using the hash value, h(k), rather than the key k. (which is most likely inappropriate for use as a bucket array index). Although an array can be used to build hash tables, it uses numbers to index its items. However, we could wish to utilize dictionaries if we want to store data and use keys other than integers, like "string." Hash tables are used to implement dictionaries in Python.

Learn more about Hash here-

https://brainly.com/question/13106914

#SPJ4

using arrays, write a program to allow a user to enter any number of double values up to 10 numbers. the user should enter -9999 to quit entering. display an error message if the user quits without entering any numbers; otherwise, display each entered value and its distance from the average.

Answers

An array is a grouping of identically typed elements that are stored in adjacent memory locations and may each be separately referred to using an index to a special identifier.

import scanner from java.util;

distance from the average in public class

{

dynamic double customerValues = new double[20];

double-static userInput;

totalValues static int = 1;

0 static int y;

totalUserInput static double = 0;

twofold static average;

void public static main (String[] args)

{

getInfoFromUser();

calculation();

}

getInfoFromUser() is a public static void.

input for the scanner = new Scanner(system.in);

"Enter an integer or enter 99999 to quit:" System.out.print;

input.nextLine()); userInput = Double.parseDouble;

If userInput equals 99999,

Enter a value here: System.out.println;

as long as (userInput!= 99999 && totalValues userValues.length)

{

userInput = userValues[totalValues];

userInput is equal to totalUserInput plus userInput.

"Enter an integer or enter 99999 to quit:" System.out.print;

input.nextLine()); userInput = Double.parseDouble;

If userInput equals 99999,

break;

totalValues++;

}

}

calculation() is a public static void.

average = all-user input divided by all-values;

"You have entered " + totalValues + " numbers and their average is " +avg," says System.out.println;

with respect to (y = 1; y totalValues; ++y)

{

System.out.println(userValues[y] + " is away from the average" + (userValues[y] - avg) + ",");

}

}

}

Learn more about array here-

https://brainly.com/question/13107940

#SPJ4

three computers were lined up in a row. the dell (d) was to the left of the viglen (v) but not necessarily next to it. the blue computer was to the right of the white computer. the black computer was to the left of the hewlett packard (hp) pc. the hewlett packard was to the left of the viglen (v). what was the order of the computers from left to right?

Answers

The order of the computers from left to right are-

Dell ;HP; Viglencolor; black white blueWhat is meant by the term arrangement?Arrangement numbers, also known as permutation numbers or merely permutations, are indeed the number of different ways a set of items can be ordered as well as arranged. An arrangement of things is simply a combination of them in general. A combination (sequence is ignored) or permutation gives the amount of "arrangements" of n items (order is significant). When dealing with permutation, one should consider both selection and arrangement.

For the given three computers -

dell (d) was to the left of the viglen (v).the blue computer was to the right of the white computerthe black computer was to the left of the hewlett packard (hp) pc.the hewlett packard was to the left of the viglen (v).

Thus, the order of the computer becomes from left to right; Dell ;HP; Viglen.

To know more about the arrangement, here

https://brainly.com/question/6018225

#SPJ4

you are configuring a new system, and you want to use a raid 0 array for the operating system using sata disks and a special controller card that includes a raid processor. which raid method should you use?

Answers

Performance improvements are the key benefit of disk striping and RAID 0. For instance, three hard drives would offer three times the bandwidth of a single drive if data were striped over them.

Disk striping would enable up to 600 IOPS for data reads and writes if each drive operated at a rate of 200 input/output operations per second (IOPS). Disk striping is similarly used in RAID 5, however this version offers fault tolerance for a single disk failure. Disk striping divides data into smaller units and saves the units across a number of drives by simultaneously reading from and writing to each disk. Disk striping is used in RAID 0 but there is no fault tolerance. Hard disk drive (HDD) minimums and maximums for RAID 5 groups are both three.

Learn more about disk striping here-

https://brainly.com/question/14018617

#SPJ4

Write a program that asks the user to enter 2 words, then prints "Equal!" if the two words are the same (case-sensitive), "Different case" if the two words are the same (case-insensitive), “Close enough” if the two words are the same length and all but the last letter matches, and "Try again" otherwise.

Answers

#include <bits/stdc++.h>

typedef std::string s;

s fi(s t, s m) {

   if(t==m) return "Equal!";

   if(strcasecmp(t.c_str(),m.c_str())==0) return "Different case!";

   if(t.size()==m.size() && t.back()!=m.back()) {

       for(int i=0;i<t.size()-1;i++) {

           if(t.c_str()[i]==m.c_str()[i]) ;

           else goto x;

       }

       return "Close enough!";

   }

   x: return "Try again!";

}

int main(int argc, char* argv[]) {

   s idx,idy;

   std::cin>>idx>>idy;

   if(idx.size()!=idy.size()) std::cout << "Try again!\n";

   else std::cout << fi(idx,idy) << std::endl;

   return 0;

}

Answer:

   Scanner scan = new Scanner(System.in);

   System.out.println("Enter 2 strings:");

   String word1 = scan.nextLine();

   String word2 = scan.nextLine();

   //equal strings

   if (word1.equals(word2))

   {

     System.out.println("Equal!");

   }

   //same word, different case

   else if (word1.toLowerCase().equals(word2.toLowerCase()))

   {

     System.out.println("Different case");

   }

   //same up to the last letter

   else if (word1.substring(0, word1.length()-1).equals(word2.substring(0, word2.length()-1)))

   {

     System.out.println("Close enough");

   }

   //no equivalency

   else

   {

     System.out.println("Try again");

   }

Explanation:

got 100% on the assignment so the code is correct

first scenario: both strings are equal, including the casing

second scenario: by setting both strings to lowercase if their cases don't match, they can be interpreted as having the same value by those standards in order to print out the statement

third scenario: .length() - 1 equates to the last letter of a string, so starting the range at 0 and ending at that will be read as the first letter to the letter before the last letter

fourth scenario: the strings do not fit into anything previously evaluated

i have implemented the queue with a linked list, keeping track of a front pointer and a rear pointer. which of these pointers will change during an insertion into a nonempty queue?

Answers

Only the rear pointers will change during an insertion into a non-empty queue if the queue is implemented using a linked list, keeping track of a front pointer.

Both values have changed because the queue has begun. If new nodes are added to the linked list's beginning during a push operation, nodes must be removed from the end during a pop operation. If additional nodes are added at the end of a push action, they must be removed at the beginning of a pop operation. Although arrays don't need space for pointers and can be accessed randomly, they are inefficient for memory allocation and insertion/deletion operations. Linked lists, on the other hand, are dynamic and have less temporal complexity for insertion and deletion.

Learn more about Queue here-

https://brainly.com/question/24108531

#SPJ4

Which of the following is considered a variable?
(1 point)
O size
O collisions
O particles
O lights

Answers

Answer:

the following that is considered that is a variableis c particles

Explanation:

5.14 lab: convert to reverse binary write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in reverse binary. for an integer x, the algorithm is: as long as x is greater than 0 output x modulo 2 (remainder is either 0 or 1) assign x with x divided by 2

Answers

A program that prints output of an algorithm in reverse is given below, complete with the algorithm:

The Algorithm

step1 = input("what number? ")#gets your input

step2 = int(step1) #makes sure it's an int not float

step3 = bin(step2) #converts it to binary (you method doesn't work for e.g. 7)

step4 = step3.replace("0b", "") #removes 0b from the binairy number

step5 = step4[::-1] #reverses the string

print (step5)

The Program

num = int(input())

while num > 0:

   y = ( num % 2 )

   print( y , end = ' ' )

   num = ( num / / 2 )

print ( )

num = int ( input ( " Enter a number " ) )

string = " "

while num > 0 :

   y = str ( num % 2 )

   string + = y

   num = ( num / / 2 )

reverse = string [ : : - 1 ]

print ( reverse )

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1

whats the difference between patents and copyright

Answers

Answer:

A copyright protects original works, such as art, literature, or other created work. A trademark protects names, short slogans, or logos. A patent protects new inventions, processes, and compositions of matter (such as medicines).

Explanation:

Cloud computing only allows you to access files on your local computer.

Answers

Answer:

Explanation:

You can store all types of information in the cloud, including files and email. This means you can access these things from any computer or mobile device with an Internet connection, not just your home computer.

Answer:

False

Explanation:

Other Questions
HELP MEEEE PLEASEEEEA pound of peppers costs $0.62. The total cost varies directly with the pounds of peppers purchased. Write an equation that relates the total cost, c, and the number of pounds of peppers purchased, p. suppose the reading rate of 6th grade students is uniformly distributed (this phrase tells you to use the uniform distribution!) between 100 and 180 words per minute. calculate probability that a selected student has a reading rate less than 115 words per minute. As you read this question, each individual word appears as a separate unit because letters are closer to each other when they are part of a word versus when they are not. This is an example of the gestalt principle of. 4. When you added the iron to the water, you saw a rise in temperature from 25 C to 47 C. If the amount of energy delivered to the water from the iron was 1100 j, what was the mass of the water in the beaker? Use specific heat of water as 4.2 j/gC.5. How much energy would it take to covert the mass of that water from # 1 from room temperature to steam at 100 C?6. Using the same mass of water, calculate the total energy needed to vaporize the water to 120 C from an ice cube at -20 C.7. In the Energy systems tab of the lab, suppose the steam from the teapot thats turning on the lightbulb is 100 C. If the mass of the steam coming out is 2.76 g, how much heat would you have to remove from the system to get the lightbulb to go out? What value is equivalent to (8+2)2 + (6 4) 3? You have 200 feet of fencing to enclose a rectangular plot that borders on a river (a long side borders the river). If you do not fence the side along the river, find the length and width of the plot that will maximize the area. What is the largest area that can be enclosed? You are to give 10 minims of a medication. How many gtts is this? PLS HELP ME WITH THIS you need to use the y=mx+b A persuasive argument may appeal to a reader's emotions (pathos) or reason (logos). Another important part of an argument's ability to persuade is the authority and expertise of the speaker (his or her ethical identity or ethos). Drag and drop the following statements into the column that describes the type of appeal made in each one.1. Ethos:2. Pathos:3. Logos:A. As a video game designer, I work hard to make games that are both entertaining and educational.B. Research shows that videogames are good for players\' minds.C. Why would people want to take away videogames and make children so sad?D. Playing video games improves thinking skills, reaction time, and hand-eye coordination.E. Video games help improve players\' reaction times. Name three pieces of information you may need when obtaining a car insurance quote. Earnings (net income) $189,000 Preferred stock (13,100 shares at $30 par, 4%) $393,000 Common stock (43,700 shares no par, market value $52) 514,000 Retained earnings 581,500 $1,488,500 Less: Treasury stock Preferred (1,700 shares)$55,000 Common (1,700 shares) 30,000 85,000 Total stockholders equity $1,403,500 Requireda. Calculate the Stuart Companys earnings per share ratio, price-earnings ratio and return on equity ratio write an email as ifyou wanted to set upan interview withsomeone Is the following a function?? Write the phrase "Four times the difference of six and y equals five less than y" as a variable expression:Write the phrase "six more than nine times n is twenty" as an equation: why is coe creek moving northeast? Question 7 of 10What causes areas closer to the equator to have warmer air than areasfarther away?OA. The indirect rays of the sun at the equatorOB. The concentrated radiation from the sun at the equatorOC. The smaller amount of heat transferred from the sun at theequatorOD. The greater angle at which the sun's rays strike Earth's surface atthe equator Danielle earns $36.80 for 4 hours of yardwork. How much does Danielle earn for 10 hours of yardwork? NEED HELP URGENTLY FOR 10 POINTS Jill converted the equation of the line 15x-4y=-2 into slope-intercept form and found the slope and y-intercept ofthe line as follows.15x-4y=-215x-4y-15x--2-15x-4y=-2-15x-4y -2-15x-422-4y-2--16xy-1-15xy=-15x+12/2154slope = Martha paid $6.35 for five pounds of chicken last week .What is the chicken's price per pound.