If you post more than 1 question, as HOMEWORKLIB RULES guideines I have to solve only 1 question.
Ques 7.
private static boolean digitAppears(NaturalNumber n, int digit)
{
while( n > 0 )
{
// if the digit at ones place is same as digit
if( n % 10 == digit )
return true;
// remove the digit at ones place
n = n / 10;
}
return false;
}
Can someone help me with these two question? 7. Complete the body y of digitAppears so...
CAN SOMEONE PLEASE SOLVE THIS? THANK YOU.
FINALTREE.JAVA:
import java.util.LinkedList;
public class FinalTree<E extends Comparable<? super E>> {
private Node<E> root;
private int size;
public FinalTree() {
root = null;
size = 0;
}
public boolean isEmpty() {
return size == 0;
}
public void add(E newItem) {
if (isEmpty()) {
root = new Node<E>(newItem);
} else {
Node<E> parent = null;
Node<E> temp = root;
int result = 0;
while (temp != null) {
parent = temp;
result =...
Hello can someone help me in my code I left it as comment task #0, task#1, task#2a and task#2b the things that I am missing I'm using java domain class public class Pizza { private String pizzaCustomerName; private int pizzaSize; // 10, 12, 14, or 16 inches in diameter private char handThinDeep; // 'H' or 'T' or 'D' for hand tossed, thin crust, or deep dish, respecitively private boolean cheeseTopping; private boolean pepperoniTopping; private boolean sausageTopping; private boolean onionTopping; private boolean...
i need help to edit the two methods below so that i can have
them work in the class provided after the two methods.
Insert and Select methods below
public void insert(String pCode, String pName,String pDesc, double c){
setProcCode(pCode);
setProcName(pName);
setProcDesc(pDesc);
setCost(c);
try {
FileWriter ff=new FileWriter("Procedures.txt",true);
BufferedWriter b=new BufferedWriter(ff);
PrintWriter pp=new PrintWriter(b);
pp.println(pCode+":"+pName+":"+pDesc+":"+c);
pp.close();
}
catch(Exception ep){
ep.printStackTrace();
}
}
public void select(String pCode){
try{
FileReader ff=new FileReader("Procedures.txt");
BufferedReader b=new BufferedReader(ff);
String ll;
StringTokenizer tt;
while((ll=b.readLine())!=null){
tt=new StringTokenizer(ll,":");
String...
Here is what I got so far
also can anyone help me align the output
#include <iostream>
#include <iomanip>
using namespace std;
class Person
{
private:
string name;
public:
Person()
{
name = "";
}
Person(string name)
{
this->name = name;
}
string getName()
{
return name;
}
void setName(string name)
{
this-> name = name;
}
};
class Publication
{
private:
int pubNumber;
string title;
Person borrower;
public:
static int count;
Publication()
{
title = "";
}...
Java programming help My program wont run. could someone tell me why. everything seems correct to me... giving me the error: Exception in thread "main" java.lang.NumberFormatException: For input string: "Stud" at java.base/java.lang.NumberFormatException.forInputString(Unknown Source) at java.base/java.lang.Integer.parseInt(Unknown Source) at java.base/java.lang.Integer.parseInt(Unknown Source) at Util.readFile(Util.java:35) at Driver.main(Driver.java:8) _________________________________________________________________________________________________________________________ Program Prompt: Write a program to perform statistical analysis of scores for a class of students.The class may have up to 40 students.There are five quizzes during the term. Each student is identified by a four-digit...
Can you help me with the last part of the question?
Problem 16-01 The stockholders' equity section of Flounder Inc. at the beginning of the current year appears below. Common stock, $10 par value, authorized 995,000 shares, 309,000 shares issued and outstanding Paid-in capital in excess of par-common stock Retained earnings $3,090,000 623,000 539,000 During the current year, the following transactions occurred. 1. The company issued to the stockholders 102,000 rights. Ten rights are needed to buy one share of...
could you please help me with this problem, also I
need a little text so I can understand how you solved the
problem?
import java.io.File; import java.util.Scanner; /** *
This program lists the files in a directory specified by * the
user. The user is asked to type in a directory name. * If the name
entered by the user is not a directory, a * message is printed and
the program ends. */ public class DirectoryList { public static...
I got stuck on these two steps, can someone help me ?
ACCOUNTING CYCLE STEP 3: Post each trans me general ledger working papers provideo teach transaction in the general journal to the general ledger. Use s provided in your packet. Posting is the process of transferring general journal entry information to the seneral ledger. Fach number you post should be properly Cross-referenced Helpful Hints by: recording the general journal page number (ex. G1, G2, etc.) in the Posting Reference...
Please help me. package a1; public class Methods { /* * Instructions for students: Use the main method only to make calls to the * other methods and to print some testing results. The correct operation of * your methods should not depend in any way on the code in main. * * Do not do any printing within the method bodies, except the main method. * * Leave your testing code...
Problem Statement: A company intends to offer various versions of roulette game and it wants you to develop a customized object-oriented software solution. This company plans to offer one version 100A now (similar to the simple version in project 2 so refer to it for basic requirements, but it allows multiple players and multiple games) and it is planning to add several more versions in the future. Each game has a minimum and maximum bet and it shall be able...