1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
-BARSIC- [3]
3 years ago
11

Given a integer, convert to String, using String Builder class. No error checking needed on input integer, However do read in th

e input integer using Scanner API. This program requires you to use a loop.
Computers and Technology
1 answer:
Gennadij [26K]3 years ago
7 0

Answer:

The program in Java will be:

// Java program to demonstrate working parseInt()  

public class GFG  

{  

   public static void main(String args[])  

   {  

       int decimalExample = Integer.parseInt("20");  

       int signedPositiveExample = Integer.parseInt("+20");  

       int signedNegativeExample = Integer.parseInt("-20");  

       int radixExample = Integer.parseInt("20",16);  

       int stringExample = Integer.parseInt("geeks",29);  

 

       // Uncomment the following code to check  

       // NumberFormatException  

 

       //   String invalidArguments = "";  

       //   int emptyString = Integer.parseInt(invalidArguments);  

       //   int outOfRangeOfInteger = Integer.parseInt("geeksforgeeks",29);  

       //   int domainOfNumberSystem = Integer.parseInt("geeks",28);  

 

       System.out.println(decimalExample);  

       System.out.println(signedPositiveExample);  

       System.out.println(signedNegativeExample);  

       System.out.println(radixExample);  

       System.out.println(stringExample);  

   }  

}

You might be interested in
5. What are some situations where you might find it useful to use the “!” symbol in a program?
svlad2 [7]

Answer:

The most common use of symbols by programmers is for performing language reflection (particularly for callbacks), and most common indirectly is their use to create object linkages. In the most trivial implementation, they have essentially named integers (e.g. the enumerated type in C).
<u>Help Me By Marking Me as Brainlist ...</u>

5 0
2 years ago
Read 2 more answers
Consider the following list. list = {24, 20, 10, 75, 70, 18, 60, 35} Suppose that list is sorted using the selection sort algori
Nadya [2.5K]

Answer:

list =  {10, 18, 24, 75, 70, 20, 60, 35}

Explanation:

Selection is a sorting algorithm that will set a cursor position and search for a minimum number from the list. When the minimum number is found, that minimum number will be swapped with the number in the cursor position. Only one number will be swapped and sorted in one iteration of outer loop. To sort the next number in the following outer loop iteration, the cursor will be moved to the next position and repeat the same search and swapping process as in the first iteration. When finishing all the iterations of outer loop, all numbers shall be sorted in ascending order.

4 0
3 years ago
A soft drink company recently surveyed 12,467 of its customers and found that approximately 14 percent of those surveyed purchas
Mnenie [13.5K]

Given Information:

Total number of customers = 12,467

Customers who purchase one or more energy drinks per week = 14%

Customers who prefer citrus flavored energy drinks = 64% of customers who purchase one or more energy drinks per week

Required Information:

1. the approximate number of customers in the survey who purchase one or more energy drinks per week

2. the approximate number of customers in the survey who prefer citrus flavored energy drinks

Code with Explanation:

#include <iostream>

using namespace std;

int main()

{

   int customers = 12467;  // total no. of customers given

   int buy_drink;  // to store the number of customers who buy one or more energy drinks per week

   int citrus_drink;  // to store the number of customers who prefer citrus flavored energy drinks

 

   buy_drink = customers*0.14;  // multiply total number of customers with the % of customers who buy energy drinks

   citrus_drink = buy_drink*0.64;  // multiply no. of customers who buy one or more energy drinks per week with % of customers who prefer citrus flavor

// display the results calculated above

   cout<<"Total number of customers: "<<customers<<endl;

   cout<<"Number of customers who buy one or more drinks per week: "<<buy_drink<<endl;

   cout<<"Number of customers who prefer citrus flavored drinks per week: "<<citrus_drink<<endl;

   return 0;

}

Output:

Total number of customers: 12467

Number of customers who buy one or more drinks per week: 1745

Number of customers who prefer citrus flavored drinks per week: 1116

7 0
3 years ago
What is the speedup of going from a 1-issue processor to a 2-issue processor? use your code from part a for both 1-issue and 2-i
Lyrx [107]
I think it is sped up by around 0.6 GHz
4 0
3 years ago
7. Which of these statements is true? Agile is a programming language MySQL is a database HTML stands for "Hypertext Markup Link
timurjin [86]

Answer:

None of them is correct, but it seems one of the option has missing words.

The exact definition is, MySQL is a database management system.

Explanation:

Agile is not a programming language, it is a software development methodology.

HTML stands for "Hypertext Markup Language"

Java and JavaScript are different languages.

Actually,  MySQL is a database management system. It is used to deal with the relational databases. It uses SQL (Structured Query Language).

5 0
3 years ago
Other questions:
  • Trevor got home from work and suddenly realized that he needed to edit a certain file stored in the company network's server. ho
    11·1 answer
  • IF YOU KNOW THE ANSWER TO THIS PLEASE ANSWER ASAP
    12·1 answer
  • What is the main purpose of cutting plane line arrows?
    7·1 answer
  • Count input length without spaces, periods, or commas Given a line of text as input, output the number of characters excluding s
    8·2 answers
  • A technician wants to consolidate and log specific alerts from network devices into a database so maintenance tasks and potentia
    11·1 answer
  • What is network management?
    12·1 answer
  • Which of the following modes of replication requires a very low latency network connection and ensures data remains in synch wit
    9·1 answer
  • Help me find the difference between these logos
    10·2 answers
  • Draw a flow chart that accepts mass and volume as input from the user. The flow chart should compute and display the density of
    8·1 answer
  • Arrange the Jumbled letters 1.eilf ngrihsa ________________ 2.cersityu ourreecs ________________ 3. ngrihsa ________________ 4.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!