Java Eclipse homework. I need help coding this

Challenge 14A - BaseConverter

Package: chall14A
Class: BaseConverter

Task: Create a program that takes user input as a decimal and converts it to either an octal, binary, or hexadecimal base:

1. Show a title on the screen for the program.
2. Ask the user if they want to run the program.
3. Create a menu for the user to choose the base to convert to.
4. Take decimal (base10) from user and print out the number in the new base.

Answers

Answer 1

import java.util.Scanner;

public class BaseConvertor {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Welcome to Base Convertor! This program will convert numbers into different bases of your choosing.");

       System.out.print("Do you still want to run the program? ");

       String ans = scan.next();

       if (ans.toLowerCase().equals("yes")){

           System.out.println("1. Octal");

           System.out.println("2. Binary");

           System.out.println("3. Hexadecimal");

           System.out.print("Type the number of the base you want to conver to: ");

           int base = scan.nextInt();

           System.out.print("Enter your number: ");

           int num = scan.nextInt();

           if (base == 1){

               

               String newNum = Integer.toOctalString(num);

               System.out.println(num+" in Octal is "+newNum);

           }

           else if (base == 2){

               String newNum = Integer.toBinaryString(num);

               System.out.println(num+" in Binary is "+newNum);

           }

           else if (base == 3){

               String newNum = Integer.toHexString(num);

               System.out.println(num+" in Hexadecimal is "+newNum);

           }

                   

       }

       else{

           System.out.println("Have a good day!");

       }

   }

   

}

I hope this helps!


Related Questions

What is the name of the setting that creates a Green Dashed line and allows you to set angular locks when activation

Answers

Answer:

Polar Tracking

Explanation:

Polar Tracking a term or function in AUTOCAD that is used to identify a point closest to a predetermined angle and define a distance along that angle. This helps creates a line (which is a green dashed line). Thereby enabling a user to set angular locks when or during activation.

Hence, in this case, the correct answer to the question is POLAR TRACKING

I need some help with this assignment. I'm having difficulty trying come up ideas to use here. Can I get any help?

Here's the question.

Think of three simple tasks where you believe sequence of instruction matters. Is there a way to modify it to where sequence doesn't matter? Find steps in each task where the sequence can be changed and still achieve the desired outcome. Write out the original and modified algorithms AND pseudocode for each task. Write a short paragraph for each task describing the changes in sequence.

Answers

Answer:

Abigail wants to attend a community college.  Suppose x represents the number of credits she takes and y represents her total fees in dollars.  Which of these statements are correct?  Select all that apply.

A.

If tuition amounts to $125 plus $150 per credit, the function that would model this situation is y = 150x + 125.

B.

If tuition amounts to $200 plus $175 per credit, the function that would model this situation is x = 175y + 200.

C.

If tuition amounts to $175 plus $150 per credit, the function that would model this situation is y = 175x + 150.

D.

If tuition amounts to $250 plus $275 per credit, the function that would model this situation is x = 250y + 275.

E.

If tuition amounts to $225 plus $200 per credit, the function that would model this situation is y = 200x + 225.

F.

If tuition amounts to $100 plus $125 per credit, the function that would model this situation is y = 125x + 100.

Explanation:

Write a program to output the following quote by Edsger W. Dijkstra:

"Computer Science is no more about computers
than astronomy is about telescopes"
- Edsger W. Dijkstra
Hint: Remember that the escape characters \n and \" can be used to create new lines and quotation marks in your code.

Answers

In python 3.8:

print("\"Computer Science is no more about \ncomputers\nthan astronomy is about telescopes\"\n-Edsger W. Dijkstra")

I hope this helps!

Write a program that asks the user to input their first and last names. The first prompt should state:

Please input your first name:
The second prompt should state:

Please input your last name:
After accepting the inputs, your program should output the input in the form last name, first name.

Hint: Remember that you can concatenate (add) two phrases by using the + symbol. Don't forget that you'll need to add a comma as well and that the comma must be followed by a space.

Answers

first = input("Please input your first name: ")

last = input("Please input your last name: ")

print(last+", "+first)

I hope this helps!

The _________ operator returns the distance in bytes, of a label from the beginning of its enclosing segment, added to the segment register.a) TYPEb) SIZEOFc) OFFSETd) LENGTHOFe) PTR

Answers

Answer:

C. Offset.

Explanation:

An offset operator can be defined as an integer that typically illustrates or represents the distance in bytes, ranging from the beginning of an object to the given point (segment) of the same object within the same data structure or array. Also, the distance in an offset operator is only valid when all the elements present in the object are having the same size, which is mainly measured in bytes.

Hence, the offset operator returns the distance in bytes, of a label from the beginning of its enclosing segment, added to the segment register.

For instance, assuming the object Z is an array of characters or data structure containing the following elements "efghij" the fifth element containing the character "i" is said to have an offset of four (4) from the beginning (start) of Z.

Read the following statements and select the
conditional statements. Check all that apply.
If my car starts, I can drive to work
It is inconvenient when the car does not start.
If my car does not start, I will ride the bus to
work
I purchased this car used, and it is not
reliable

Answers

if my car starts, i can drive to work

if my car does not start, i will ride the bus to work

Answer:

if my car does not start, i will ride the bus to work

if my car starts, i can drive to work

Explanation:

What property must be set on a menu item to have the user activate that option by pressing Ctrl C on the keyboard

Answers

Answer:

ShortcutKeys

Explanation:

ShortcutKeys is a term used in computing to describe a combination of two or more keys to perform specific actions in a faster way.

Some shortcut keys have been programmed on the operating system of the computer, while a user can also create some through scripting coding.

For example, Ctrl + B is for Bold, while Ctrl + A is for select all.

Hence, to have the user activate the SHORTCUT option by pressing Ctrl C on the keyboard, a SHORTCUTKEYS property must be set on a menu item

Write a code for function main, that does the following: creates a variable and assign it the value True. uses a while loop which runs as long as the variable of the previous step is True, inside the while loop, get three integer numbers n1, n2 and n3 from the user and

Answers

Answer:

def main():

   is_true = True

   while is_true == False:

       try:

           num1 = int(input("Enter first number: ")

           num2 = int(input("Enter second number: ")

           num3 = int(input("Enter third number: ")

       except ValueError:

           print("Input must be an integer number")

       is_true = bool(input("do you want to end loop? True/False: "))

main()

Explanation:

The python main function above continuously creates three integer numbers in a while loop statement until a false input is received from the user.

) Printers today have many features that include improved quality, photo printing capabilities, digital camera connectivity, built-in flash memory card readers, wireless connectivity, and faster speed. Suppose you are in the market for a new personal printer. Make a list of the most important features needed to meet your needs, and then research printers to identify the best printer for your needs. Be sure to consider both the price of the printer and the price of consumables (such as paper and ink/toner) in your evaluation process. (3 marks)

Answers

Explanation:

Some of the most important features needed in a printer are:

fast printing speedsupport wireless connectivitysupport colored/uncolored printinginclude improved text quality,improved photo printing capabilities

Based on market prices available on the Amazon website, a printer with the above capabilities start at a price range of at least $80.

Claire wants to be a digital media coordinator. What requirements does she need to fulfill in order to pursue this career?

To be a digital media coordinator, Claire needs a bachelor’s degree in _______ digital media, or a related field. She also needs to have knowledge of _______ and emerging digital technologies.

1st blank:
psychology
public relations
finance

2nd blank:
computer programming
computer coding
search engine optimization

Answers

Answer:

1. Public Relations

2. Search Engine Optimization

Explanation:

Given that a public relations degree holder can work in various capacities such as Advertising, Media, Event, and Sale promotion position. Hence Claire needs a bachelor’s degree in PUBLIC RELATIONS.

Similarly, given that the knowledge of Search Engine Optimization is crucial in Digital media coordination, as it helps to drive and gain web or online traffic both in quality and quantity.

Hence, Claire also needs to know about Search Engine Optimization.

what is suitable equipment to meet customer needs from
1 stand alone pcs
2 networked pcs
3 servers
4 network equipment
5 operating system
6 application software

Answers

uh i think it’s uh carrot

what are the types of slide show in powerpoint? define.​

Answers

Answer:

normal view

slide sorter view

master view

notes page view

What is a contact position ?

Answers

Answer:

the poses that connect the extremes in motion

Explanation:

In a program a menu shows a list of?

Answers

Answer:

implemented instructions

90 points can someone please write the code for this (HTML):


A text field to enter your name.

At least three multiple choice questions where only one answer can be chosen.

A word problem with a text area for the user to type in the answer.

At least three different math symbols using correct ampersand notation.

A Submit button at the end of the test.

Comment tags that indicate the start and end of the test.


I need to get this done really soon, please help. I couldn't find any text to HTML sites that included multiple choice and Interactive buttons.

Answers

Answer:

Explanation:

1.

First name:

Last name:

.

2.

What fraction of a day is 6 hours?

Choose 1 answer

6/24

6

1/3

1/6

Submit

</p><p> // The function evaluates the answer and displays result</p><p> function displayAnswer1() {</p><p> if (document.getElementById('option-11').checked) {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> }</p><p> if (document.getElementById('option-12').checked) {</p><p> document.getElementById('block-12').style.border = '3px solid red'</p><p> document.getElementById('result-12').style.color = 'red'</p><p> document.getElementById('result-12').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-13').checked) {</p><p> document.getElementById('block-13').style.border = '3px solid red'</p><p> document.getElementById('result-13').style.color = 'red'</p><p> document.getElementById('result-13').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-14').checked) {</p><p> document.getElementById('block-14').style.border = '3px solid red'</p><p> document.getElementById('result-14').style.color = 'red'</p><p> document.getElementById('result-14').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> }</p><p> // the functon displays the link to the correct answer</p><p> function showCorrectAnswer1() {</p><p> let showAnswer1 = document.createElement('p')</p><p> showAnswer1.innerHTML = 'Show Corrent Answer'</p><p> showAnswer1.style.position = 'relative'</p><p> showAnswer1.style.top = '-180px'</p><p> showAnswer1.style.fontSize = '1.75rem'</p><p> document.getElementById('showanswer1').appendChild(showAnswer1)</p><p> showAnswer1.addEventListener('click', () => {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> document.getElementById('showanswer1').removeChild(showAnswer1)</p><p> })</p><p> }</p><p>

3.<p> rows="5" cols="30"</p><p> placeholder="type text.">

4. <p>I will display &euro;</p>

<p>I will display &part;</p>

<p>I will display &exist;</p>

5. <input type="submit">

6. This code should be the first code

<!-- This is a comment -->

<p>Start Test.</p>

<!-- Remember to add more information here -->

This code should be the last and at the end of the of the html code

<!-- This is a comment -->

<p>End Test.</p>

<!-- Remember to add more information here -->

Notice: Answers may not be accurate and may be accurate. And pls endeavor to edit any part of the html code.

What does cpu mean ​

Answers

Answer:

CPU or Central processing unit is the principal part of any digital computer system, generally composed of the main memory, control unit, and arithmetic-logic unit.

Hope this helps and if you could mark this as brainliest. Thanks!

What printer prints in different languages ​

Answers

Answer:

Printing in a different language

HP Deskjet 2630.Microsoft Windows 10 (32-bit)

Consider the use of 1000-bit frames on a 1-Mbps satellite channel with a 270-ms delay. What is the maximum link utilization for,
a. Stop-and-wait flow control?
b. Continuous flow control with a window size of 7?
c. Continuous flow control with a window size of 127?

Answers

i feel as if it would be B.

_______________ is a computer networking protocol used by hosts to retrieve IP address assignments.

Answers

Answer:

DHCP

Explanation:

stands for dynamic host configuration protocol and is a network protocol used on IP networks where a DHCP server automatically assigns an IP address and other information to each host on the network so they can communicate efficiently with other endpoints.

Comment on the following 2 arrays. int *a1[8]; int *(a2[8]); a1 is pointer to an array; a2 is array of pointers a1 is pointer to an array; a2 is pointer to an array a1 is array of pointers; a2 is pointer to an array a1 is array of pointers; a2 is array of pointers

Answers

Answer:

The answer is "a1 and a2 is an array of pointers".

Explanation:

In this question, A collection of pointers refers to an array of elements where each pointer array element points to a data array element. In the above-given statement, the two-pointer type array "a1 and a2" is declared that holds the same size "8" elements in the array, and each element points towards the array's first element of the array, therefore, both a1 and a2 are pointer arrays.

A computer is using a fully associative cache and has 216 bytes of memory and a cache of 64 blocks, where each block contains 32 bytes.

Required:
a. How many blocks of main memory are there?
b. What is the format of a memory address as seen by the cache, that is, what are the sizes of the tag and offset fields?
c. To which cache block will the memory address F8C9 (subscript) 16 map?

Answers

1) The number of blocks of main memory that are there are;

2^16/32 = 2^16/2^5 = 2^11

2) The format of a memory address as seen by the cache,that is the sizes of the tag and offset fields are;

16 bit addresses with 11 bits also in the tag field and the 5 bits in the word field.

3) The cache block that the memory address F8C9 (subscript) 16 map;

Since it is an associative cache, it can actually map anywhere.

That is, it has the ability of mapping anywhere.

Need help with 4.7 lesson practice

Answers

Answer: Question 1 is A  Question 2 is C

Explanation:

Individuals who break into computer systems with the intention of doing damage are called​ _____________.

a. white hats
b. ​e-criminals
c. hackers
d. keyloggers
e. black hats

Answers

I think the answer is hackers

The individuals who made the unethical entry into a person's system with intentions of damage are termed, hackers. Thus, option C is correct.

What is a computer system?

A computer system has been given as the network connection of the hardware and the software equipped with the objects that are used for the operation of the computer.

The computer system with the internet connection has been able to make the connection to the world. as well the invention mediates the work with ease as well.

The system thereby has the access to the passwords and the personal details of an individual as well. There are individuals who try to make access the computer system in an unethical way and intended to damage the system.

The computer viruses are used for the following purpose and were drawn by the hackers. Thus, option C is correct.

Learn more about the computer system, here:

https://brainly.com/question/14253652

#SPJ2

Write a sed command that will display all lines of the birthday file that do not contain the string March. What was the sed command?

Answers

Answer:

sed '/march/{d;}' birthdays.txt > result .txt

Explanation:

sed syntax is basically:

sed '/expression/{command;command;...;}' inputfile > outputfile

First, for the expression part, we use /march/ to match all lines containing that string. Then for the command part, we only use {d} command to delete every matching line found.The third part contains the input file to process, I have named it birthdays.txt, but it could have been any other file needed.Finally "> result .txt" makes the script output to be saved into a file named result.txt

Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the element. Ex: lowerScores = {5, 0, 2, -3} becomes {4, 0, 1, 0}.Sample program:#include using namespace std;int main() { const int SCORES_SIZE = 4; vector lowerScores(SCORES_SIZE); int i = 0; lowerScores.at(0) = 5; lowerScores.at(1) = 0; lowerScores.at(2) = 2; lowerScores.at(3) = -3; for (i = 0; i < SCORES_SIZE; ++i) { cout << lowerScores.at(i) << " "; } cout << endl; return 0;}Below, do not type an entire program. Only type the portion indicated by the above instructions (and if a sample program is shown above, only type the portion.)

Answers

Answer:

Replace <STUDENT CODE> with

for (i = 0; i < SCORES_SIZE; ++i) {

       if(lowerScores.at(i)<=0){

           lowerScores.at(i) = 0;

       }

       else{

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Explanation:

To do this, we simply iterate through the vector.

For each item in the vector, we run a check if it is less than 1 (i.e. 0 or negative).

If yes, the vector item is set to 0

If otherwise, 1 is subtracted from that vector item

This line iterates through the vector

for (i = 0; i < SCORES_SIZE; ++i) {

This checks if vector item is less than 1

       if(lowerScores.at(i)<1){

If yes, the vector item is set to 0

           lowerScores.at(i) = 0;

       }

       else{

If otherwise, 1 is subtracted from the vector item

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Also, include the following at the beginning of the program:

#include <vector>

what will be output of this program a. less than 10 b. less than 20 c. less than 30 d. 30 or more

Answers

Answer:

D. 30 or more

Explanation:

The score value is passed in as var, meaning, its value could change. In this instance score started at zero and 30 was added to it. The last condition is the only condition that fits score's value(if that makes sense). So its in fact D.

hope i was able to help ;)

In a three-tier architecture, the component that runs the program code and enforces the business processes is the:_______.

Answers

Answer:

Application Server

Explanation:

The Application Server is a component in computer engineering that presents the application logic layer in a three-tier architecture.

This functionality allows client components to connect with data resources and legacy applications.

In this process of interaction, the Application Server runs the program code from Tier 1 - Presentation, through Tier 2 - Business Logic to Tier 3 - Resources, by forcing through the business processes.

Most operating systems perform these tasks. coordinating the interaction between hardware and software allocating RAM to open programs creating and maintaining the FAT modifying word processing documents correcting spreadsheet formulas displaying the GUI

Answers

Answer:

The answer are A.) Coordinating the interaction between hardware and software And B.) Allocating RAM to open programs

Explanation:

Hope this helps :)

Tasks that are been performed by most operating systems are;

Coordinating the interaction between hardware and software.Allocating RAM to open programs.

An operating system can be regarded as system software which helps in running of computer hardware as well as software resources and mange them.

This system provides common services for computer programs.

It should be noted that  operating system coordinating the interaction between hardware as well software.

Therefore, operating system, allocate RAM to open programs.

Learn more about operating system at:

https://brainly.com/question/14408927


What is a file type and why is it important? Give at least three examples of file
types, including the associated file extension and
program.

Answers

What's in the setting file ?

For risk monitoring, what are some techniques or tools you can implement in each of the seven domains of a typical IT infrastructure to help mitigate risk

Answers

Answer:

 a. User Domain: Create awareness for acceptable user-policies and security risk to educate employees of pending risk.

b. Workstation Domain: Install anti-virus and constantly update the system software.

c. LAN Domain:  Access control list or ACL should be configured in routers and port security in switches to avoid hackers physically connecting to the network.

d. LAN-to-WAN Domain: Configure firewalls and intrusion detection and prevention protocols to mitigate unwanted access.

e. WAN Domain: Configure demilitarized or demarcation zone to provide secure access and prevent unwanted users from accessing network information.

f. Remote Access Domain: The use of VPNs to grant remote access to users or employees working from home and internet protocol security (IPsec) to encrypt the packet transmission.

g. Systems/Applications Domain: Administration should be well trained and ensure to get security software patches from appropriate vendors and testing them before use.

Explanation:

Risk monitoring is one of the IT infrastructure risks management plan that observes and analyzes the threats of risk in an IT infrastructure.

Other Questions
Which multiplication expression is equal to 1/4 divided by 1/3 Hurry Please!Read lines 46-47 from the poem.The gray sky is confused and scurrying;It is rosy in spite of itself.What is the meaning of the figurative language used in these lines?A The gray sky moves quickly back and forth in a very confused way.B The gray sky seems to be hiding behind buildings so people can no longer see it.C The gray sky reveals a developing a storm system that will soon bring rain.D The gray sky has clouds moving across it, reflecting light from the setting sun. plzzzzzzzzzzzzzzzzzzzzzzzzzz help 20 points Select the correct answer. What does the word courier mean based on the context clues provided? When Hector arrived at home, his mother informed him that a courier had delivered an important letter for him earlier that day. A. an operator B. an assistant C. an employee D. a messenger 3x+8 How you will gather and formulate your data Candace works for a small marketing firm that focuses on ads that pop up on social media web pages. Candace mostlikely works inO Marketing Research.O Professional Sales.O E-Marketing.O Distribution and Logistics. Question 3 :Furniture of vendor firm recorded inthe books at Rs.2,50,000, were takenover by the partner at an agreedvalue of Rs.1,75,000, the amount tobe debited to partners' capitalaccount will be:Rs. 2,50,000Rs.75,000Rs.4,25,000Rs. 1,75,000 what format can be applied to text in excel? What do you do when your expectation does not match your reality? Include how to apply the OODA LOOP in your answer. Type only a number for your answer What is the rate of change of y with respect to x for 25x - 4y = 50 ? which expression is equal to 5/2? Write a situation that could represent the fraction above. Change each sentence into the alternative negative form. Activity 1: Fill in the blank. Drag each word to thecorrect statement.1. Which segment is responsible for safe handling of the animal product (beet porkJamb) in their homes?2. Who is responsible for raising a healthy animal?3. Which segment carries the animal from the farm to the market?4. Which segment sells the animal to the packer?5. Which segment harvests the animal?6. Which segment processes the carcasses into retail cuts?7. Which segment involves a negotiator?processingconsumerharvestingWord Bankproducertransportationreafood In the equation a= 3/b is a positive, real number. As thevalue of b is increased so it becomes closer and closer toinfinity, what happens to the value of a ? What type of drug is heroin? An open-top box is to be made from a 12-inch by 24-inch piece of plastic by removing a square from each corner of the plastic and folding up the flaps on each side. What is the maximum possible volume, in cubic inches, of the box? An N-scale model railroad caboose is 3 inches long. N scale is 169 feet to 1 foot.Let c represent the length of a real caboose. Write a proportion, in terms of c, that can be used to solve for the length of a real caboose. (Hint: Compare feet to inches. How many inches are in one foot?)How long (in feet) is a real caboose?ft " " ( ; - 1941-1945 ., .